Add Quobit to OpenCode as an OpenAI-compatible provider. Tested with OpenCode 1.19.5.

Step 1 — Install

Install the OpenCode CLI with npm, or use any other installer from the OpenCode documentation.

shell
npm install -g opencode-ai
opencode --version

Step 2 — Provide your API key

OpenCode reads the key from an environment variable, so the key never sits in the config file.

macOS / Linux
export QUOBIT_API_KEY="<your-api-key>"

Create your own key under API keys and treat it as private: do not commit it, paste it into tickets or chat, or write it into logs.

Step 3 — Create opencode.json

Save this as opencode.json in your project folder, or as the global OpenCode config (~/.config/opencode/opencode.json) to use it in every project. The base URL ends with /v1. small_model is used for quick background tasks such as session titles, so it points at a fast model.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "quobit": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Quobit",
      "options": {
        "baseURL": "https://api.quobit.ai/v1",
        "apiKey": "{env:QUOBIT_API_KEY}"
      },
      "models": {
        "glm-5.2": { "name": "GLM-5.2" },
        "kimi-k2.7-code": { "name": "Kimi K2.7 Code" }
      }
    }
  },
  "model": "quobit/glm-5.2",
  "small_model": "quobit/kimi-k2.7-code"
}

The file contains no key — {env:...} tells OpenCode to read it from the environment.

Step 4 — Test the connection

shell
opencode run "Reply with exactly: OK"

With a correct configuration OpenCode replies "OK". In the interactive app, pick the model with /models.

Notes

  • List any other public alias you want to use under "models" with the same name as on the Models page.

Common errors

  • 401 authentication error: the key is missing, revoked or mistyped. Check that QUOBIT_API_KEY is set in the same terminal that runs the client.
  • 404 or model not found: use a public model alias enabled for your plan, exactly as shown on the Models page.
  • 400 context too long: the conversation plus the requested output is longer than your plan allows per request. Start a new chat or shorten the conversation.
  • 429 rate_window_exceeded: you have reached your plan's 5-hour cost window. Wait for it to roll over, or upgrade your plan.