Unquant

Opening your workspace…

Unquant

How to add Unquant to OpenCode

OpenCode takes any OpenAI-compatible endpoint as a custom provider. Add Unquant to your config and pick the model from OpenCode's model list.

Setup guide2 min readUpdated 1 October 2026
  1. 1

    Set your key

    export UNQUANT_API_KEY=your-unquant-key
  2. 2

    Add the provider

    In opencode.json in your project, or ~/.config/opencode/opencode.json for every project:

    {
      "$schema": "https://opencode.ai/config.json",
      "provider": {
        "unquant": {
          "npm": "@ai-sdk/openai-compatible",
          "name": "Unquant",
          "options": {
            "baseURL": "https://api.unquant.io/v1",
            "apiKey": "{env:UNQUANT_API_KEY}"
          },
          "models": {
            "glm-5.3-flash": { "name": "GLM-5.3-Flash", "limit": { "context": 262144, "output": 32768 } },
            "qwen-3.8-flash-next": { "name": "Qwen 3.8 Flash Next", "limit": { "context": 262144, "output": 32768 } }
          }
        }
      }
    }
  3. 3

    Choose the model

    Restart OpenCode, run /models and pick Unquant · GLM-5.3-Flash.

401
Unauthorized

Check UNQUANT_API_KEY is set where OpenCode runs.

403
Not included in your subscription

Pick the model on your plan.

429
Concurrent stream limit reached

Another request is still running on your account.

262K
Session too large to compact

The models have no limit in opencode.json, so OpenCode never compacted and the session outgrew the window. Add the limits above. The gateway now trims the oldest turns out of OpenCode's summary request, so running the compaction again lets the session continue.

Keep reading