Use OpenCode with open models

Use open models such as GLM-5.3-Flash in OpenCode. Connect Munito AI from the provider list, or add it as a custom OpenAI-compatible provider.

Munito AI is in the provider list of OpenCode, which comes from models.dev. OpenCode runs open models through the OpenAI-compatible Chat Completions API.

Connect from the provider list

  1. Create an API key.
  2. In OpenCode, run /connect, search for Munito AI, and paste the key. To keep processing in the EU, pick Munito AI (EU).
  3. Run /models and pick a model, such as munito/zai-org/glm-5.3-flash, or munito-eu/zai-org/glm-5.3-flash on the EU host.

OpenCode keeps the key in ~/.local/share/opencode/auth.json. The list holds the chat models of each host. Models and pricing lists every model and its regions. OpenCode refreshes its copy of models.dev on its own, when it starts and every hour. If Munito AI is not in the list, run opencode models --refresh, or add the provider by hand as the next section shows.

Add the provider by hand

Export the key as MUNITO_API_KEY:

export MUNITO_API_KEY=munitoai_...

Add this configuration to ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "munito/zai-org/glm-5.3-flash",
  "provider": {
    "munito": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Munito",
      "options": {
        "baseURL": "https://api.munito.ai/inference/v1",
        "apiKey": "{env:MUNITO_API_KEY}"
      },
      "models": {
        "zai-org/glm-5.3-flash": {
          "name": "GLM-5.3-Flash",
          "limit": {
            "context": 1048576,
            "output": 943718
          },
          "variants": {
            "low": {
              "reasoningEffort": "low"
            },
            "high": {
              "reasoningEffort": "high"
            },
            "max": {
              "reasoningEffort": "max"
            }
          }
        }
      }
    }
  }
}

Run opencode. The command opencode run "<task>" runs one task without the terminal UI. OpenCode names a model by the provider ID and the model ID: munito/zai-org/glm-5.3-flash. {env:MUNITO_API_KEY} reads the key from the environment, so the file holds no key. The limit tells OpenCode the context window of GLM-5.3-Flash, 1,048,576 tokens, so that it compacts the conversation before the window is full.

OpenCode 1 and OpenCode 2 both read this configuration. Munito AI tested it with OpenCode 1.19.4 and 2.1.3. See the OpenCode docs for custom providers and for the OpenCode 1 configuration in OpenCode 2.

Use a regional host to keep processing in the EU. Replace the baseURL with https://api.eu.munito.ai/inference/v1.

To add a model, add its ID and its limit to models, then select it with /models in OpenCode. The page of each chat model in the model catalog gives its model ID, its context and its maximum output.

Reasoning effort

GLM-5.3-Flash always reasons. The variants map gives OpenCode the effort levels of the model: low, high and max. Without a level, the model reasons at its default effort. Press ctrl+t in the terminal UI to change the level. For one task, OpenCode 1 takes --variant, and OpenCode 2 takes the level after the model ID:

# OpenCode 1
opencode run --variant high "<task>"

# OpenCode 2
opencode run -m munito/zai-org/glm-5.3-flash#high "<task>"

Another model can declare other levels. See Reasoning models and the OpenCode docs for variants.