Skip to Content

OpenCode

Use open models such as GLM-5.3-Flash in OpenCode. Connect Munito AI from the provider list of OpenCode, or with an API key in the environment.

For a remote workspace, use OpenCode as a cloud agent.

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. This guide needs OpenCode 2.

Connect

  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 below Munito AI or Munito AI (EU), such as GLM-5.3-Flash.
  • The line below the prompt shows the model and its provider, such as GLM-5.3-Flash Munito AI (EU).
  • OpenCode keeps the key in its database, ~/.local/share/opencode/opencode.db.
  • The list holds the chat models that models.dev lists for each host. Models lists every model and its regions.

Run one task

opencode run -m munito-eu/zai-org/glm-5.3-flash "<task>"
  • OpenCode names a model by the provider ID and the model ID.
  • The provider ID is munito for Munito AI and munito-eu for Munito AI (EU). Use the provider that you connected.
  • opencode run runs one task without the terminal UI.

Allow only Munito AI

OpenCode has other providers too. When Munito AI is not available, OpenCode takes a model of another provider, with no error. To prevent that, and to set the default model, add this to ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "model": "munito-eu/zai-org/glm-5.3-flash",
  "policies": [
    {
      "action": "provider.use",
      "resource": "*",
      "effect": "deny"
    },
    {
      "action": "provider.use",
      "resource": "munito*",
      "effect": "allow"
    }
  ]
}
  • OpenCode then offers only Munito AI and Munito AI (EU).
  • When neither is available, OpenCode stops with No model is available.

Use a variable in place of /connect

For a script or a CI job, export the key as MUNITO_API_KEY:

export MUNITO_API_KEY=munitoai_...

OpenCode then offers Munito AI and Munito AI (EU) with no /connect.

OpenCode keeps a background server, and that server reads the variable when it starts. If OpenCode answers Model unavailable, No model is available or Missing API key, restart the server from a shell that has the variable:

opencode service restart

Add a model

The provider list does not hold every chat model of Munito AI. To add one, put it below its provider in ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "providers": {
    "munito-eu": {
      "models": {
        "google/gemma-4-12b": {
          "name": "Gemma 4 12B",
          "limit": {
            "context": 32768,
            "output": 29491
          }
        }
      }
    }
  }
}
  • The page of each chat model in the model catalog gives its model ID, its context and its maximum output.
  • The limit tells OpenCode the context window of the model, so that it compacts the conversation before the window is full.
  • For another regional host, set settings.baseURL of the provider, such as "settings": { "baseURL": "https://api.us.munito.ai/inference/v1" } below munito.

Reasoning effort

GLM-5.3-Flash always reasons, and its effort levels are low, high and max. Without a level, the model reasons at its default effort.

  • In the terminal UI, /models asks for the level after the model, and ctrl+t changes it.
  • For one task, put the level after the model ID:
opencode run -m munito-eu/zai-org/glm-5.3-flash#high "<task>"

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