> ## Documentation Index
> Fetch the complete documentation index at: https://docs.muna.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode

> Use open models on Muna in OpenCode.

[OpenCode](https://opencode.ai) connects to any OpenAI-compatible API through a custom provider.

## Configuring OpenCode

Add Muna as a provider in `opencode.json`, either in your project or in `~/.config/opencode/opencode.json`:

```json theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "muna": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Muna",
      "options": {
        "baseURL": "https://inference.muna.ai/v1",
        "apiKey": "{env:MUNA_API_KEY}"
      },
      "models": {
        "@qwen/qwen-3.8-27b": { "name": "Qwen 3.8 27B" },
        "@google/gemma-4-26b-a4b-it": { "name": "Gemma 4 26B" }
      }
    }
  }
}
```

`{env:MUNA_API_KEY}` reads the key from your environment, so it never lands in the config file.

Start OpenCode in your project directory and pick a Muna model with `/models`:

```bash theme={null}
opencode
```

<Tip>
  List any chat model from [Models](/inference/models) under `models`. The key is the
  Muna model tag; `name` is only what OpenCode shows in its picker.
</Tip>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.