Use GLM-5.3 in OpenCode: setup and pricing

Add BigModel.io as a provider in opencode.json to run GLM-5.3 (glm-5.3) in OpenCode. $0.20 input / $0.64 output per 1M tokens, with a config you can paste.

Model ID
glm-5.3
Input / 1M
$0.20
Output / 1M
$0.64
Context
1M

Set up OpenCode with GLM-5.3

  1. Create an API key in the BigModel.io console and give it a spend limit; agents send long contexts.
  2. Put the block below in ~/.config/opencode/opencode.json and export BIGMODEL_API_KEY in your shell.
  3. Run opencode; /models lists glm-5.3 under BigModel.io.

~/.config/opencode/opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "bigmodel": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "BigModel.io",
      "options": {
        "baseURL": "https://bigmodel.io/v1",
        "apiKey": "{env:BIGMODEL_API_KEY}"
      },
      "models": {
        "glm-5.3": {
          "name": "GLM-5.3",
          "limit": {
            "context": 1000000,
            "output": 128000
          }
        }
      }
    }
  },
  "model": "bigmodel/glm-5.3"
}

Check the key and model first

This request should return a short reply. If it fails, the tool will fail the same way.

curl https://bigmodel.io/v1/chat/completions \
  -H "Authorization: Bearer $BIGMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"glm-5.3","messages":[{"role":"user","content":"ping"}]}'

401 means the key is wrong, 404 the model ID; fix 401 · fix 404

What it costs

GLM-5.3 costs $0.20 per 1M input tokens and $0.64 per 1M output tokens, $0.04 per 1M cached input tokens. A typical agent turn with 20K tokens in and 2K out costs about $0.0053; 100 turns about $0.528. GLM-5.3 pricing →

Other setups