Skip to main content
All clients

OpenCode

Open-source terminal agent with a provider registry.

Base URL
https://api.bf16.ai/v1
Protocol
openai-completions

Who this is for
People who keep several providers configured at once.

Commands show $BF16_API_KEY. Sign in to fill in your own key automatically.

  1. 1

    Export your key

    OpenCode reads BF16_API_KEY from your shell environment.

    export BF16_API_KEY=sk-bf16-v1-...
  2. 2

    Add bf16 to your config

    New file: paste the whole thing. Already have one: paste only the bf16 block inside your existing "provider" object, keeping the others.

    ~/.config/opencode/opencode.json
    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "bf16": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "bf16.ai",
          "options": {
            "baseURL": "https://api.bf16.ai/v1",
            "apiKey": "{env:BF16_API_KEY}"
          },
          "models": {
            "zai-org/glm-5.3-uncensored": {
              "name": "Uncensored GLM-5.3",
              "reasoning": true,
              "temperature": true,
              "tool_call": true,
              "modalities": { "input": ["text"], "output": ["text"] },
              "limit": { "context": 1048576, "output": 131072 }
            },
            "zai-org/glm-5.3-flash-uncensored": {
              "name": "Uncensored GLM-5.3 Flash Vision",
              "attachment": true,
              "reasoning": true,
              "temperature": true,
              "tool_call": true,
              "modalities": { "input": ["text", "image"], "output": ["text"] },
              "limit": { "context": 1048576, "output": 131072 }
            },
            "deepseek/deepseek-v4.1-flash-uncensored": {
              "name": "Uncensored DeepSeek V4.1 Flash",
              "attachment": true,
              "reasoning": true,
              "temperature": true,
              "tool_call": true,
              "modalities": { "input": ["text", "image"], "output": ["text"] },
              "limit": { "context": 1048576, "output": 130000 }
            },
            "deepseek/deepseek-v4.1-flash-uncensored-fast": {
              "name": "Uncensored DeepSeek V4.1 Flash Fast",
              "attachment": true,
              "reasoning": true,
              "temperature": true,
              "tool_call": true,
              "modalities": { "input": ["text", "image"], "output": ["text"] },
              "limit": { "context": 1048576, "output": 130000 }
            }
          }
        }
      }
    }
  3. 3

    Pick a model and say hello

    opencode --model bf16/zai-org/glm-5.3-flash-uncensored

How to know it worked

  • bf16 appears under /models inside OpenCode.
  • Send "Say ok." and the request lands in your console logs.
  • curl https://api.bf16.ai/v1/models -H "Authorization: Bearer $BF16_API_KEY"

Common errors

Symptom
Invalid API key after rotating a key.
Cause
OpenCode stores the key it was given separately, and that copy wins over the config.
Fix
Re-enter the key through OpenCode’s own connect flow after creating a new one.
Symptom
The model list is empty.
Cause
The baseURL is missing its /v1 suffix.
Fix
Use https://api.bf16.ai/v1.

Do not have it yet?

curl -fsSL https://opencode.ai/install | bash
Official docs