OpenCode · Facts verified 2026-10-14

How do I use GLM 5.3 in OpenCode?

Add z-ai/glm-5.3 and z-ai/glm-5.3-flash under a standardcompute provider in opencode.json (base URL https://api.stdcmpt.com/v1), with GLM 5.3 as the model and Flash as small_model: OpenCode runs GLM 5.3 with no Z.ai account, on a plan from $19 a month that answers HTTP 402 to new requests once the compute budget is used.

opencode.jsonchat completions
{
  "$schema": "https://opencode.ai/config.json",
  "model": "standardcompute/z-ai/glm-5.3",
  "small_model": "standardcompute/z-ai/glm-5.3-flash",
  "provider": {
    "standardcompute": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Standard Compute",
      "options": {
        "baseURL": "https://api.stdcmpt.com/v1",
        "apiKey": "{env:STANDARDCOMPUTE_API_KEY}"
      },
      "models": {
        "z-ai/glm-5.3": {
          "name": "GLM 5.3",
          "reasoning": true,
          "limit": { "context": 400000, "output": 32000 }
        },
        "z-ai/glm-5.3-flash": {
          "name": "GLM 5.3 Flash",
          "reasoning": true,
          "attachment": true,
          "modalities": { "input": ["text", "image"], "output": ["text"] },
          "limit": { "context": 400000, "output": 32000 }
        }
      }
    }
  }
}

GLM 5.3 has no attachment or modalities lines because it is text-only; GLM 5.3 Flash has both, so OpenCode attaches screenshots when you switch to it.

Screenshots need GLM 5.3 Flash

GLM 5.3 is text-only; an image sent to it fails with HTTP 400. Only the Flash entry carries attachment and image modalities, so OpenCode attaches pasted screenshots only after you pick standardcompute/z-ai/glm-5.3-flash in /models. OpenCode treats a model you add by hand as text-only until it has attachment: true and modalities.input with image, so the config sets both on models that read images.

GLM 5.3 or Flash, side by side

GLM 5.3GLM 5.3 Flash
ImagesHTTP 400Read
ReasoningAlways on; a request to switch it off runs at low effortAlways on, same
Typical day at Z.ai list price$3.65$0.41
Busy day$37$4.14
Typical days in the Starter plan's $20 compute budget549

Z.ai list prices per million tokens: GLM 5.3 $1.40 input, $0.26 cached, $4.40 output; Flash $0.15, $0.03, $0.50. Source. A typical day is 8.5M tokens and a busy one 86.7M, 87.2% of input as cache reads: the median and 90th-percentile coding-agent day in our Agent Burn Index, measured on OpenCode, Cline, Kilo and similar agents, September 13 to October 12, 2026. Priced at the list rates above; your own days will differ.

GLM 5.3: model ID, providers and price

Before your first session

  • Without a limit block OpenCode records a context of 0 and never compacts ahead of time; it only compacts after the endpoint rejects an oversized request.
  • OpenCode has no built-in reasoning variants for GLM 5.3 IDs; the effort comes from the Models page unless you add a variants block.
  • opencode models standardcompute lists what OpenCode resolved, including both GLM entries.

The catch

If GLM is all you use, compare two OpenCode-native routes first. OpenCode's built-in Z.AI Coding Plan provider (zai-coding-plan/glm-5.3) takes a GLM Coding Plan key, a plan Z.ai sells from $18 a month. And OpenCode Go ($10) includes GLM 5.3 with a $15 monthly usage limit ($120 on Go Plus).

Where Standard Compute fits

GLM 5.3 next to Claude, GPT and Gemini on one key, billed by card in US dollars, with one budget across every model instead of a limit per model.

FAQ

Why does OpenCode ignore my screenshot on GLM 5.3?

For a model you add by hand, OpenCode only attaches images when the entry has attachment: true and image in modalities.input. GLM 5.3 has neither because it is text-only; switch to GLM 5.3 Flash for that turn.

GLM 5.2 or GLM 5.3 in OpenCode?

GLM 5.3. Z.ai lists both at the same price, and 5.3 takes reasoning levels where 5.2 only switches reasoning on or off.

Related setup guides