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

# OpenCode

> Use Kyma with OpenCode — open source coding assistant.

OpenCode is an open source AI coding assistant that runs in your terminal. It supports OpenAI-compatible APIs.

## Configuration

Set these environment variables:

```bash theme={null}
export OPENAI_API_KEY="ky-your-api-key"
export OPENAI_BASE_URL="https://kymaapi.com/v1"
```

Then run:

```bash theme={null}
opencode --model qwen-3.6-plus
```

Or configure in your settings file:

```json theme={null}
{
  "provider": "openai",
  "base_url": "https://kymaapi.com/v1",
  "api_key": "ky-your-api-key",
  "model": "qwen-3.6-plus"
}
```

## Recommended Models

| Model               | Alias   | Best For                                                              |
| ------------------- | ------- | --------------------------------------------------------------------- |
| `qwen-3.6-plus`     | `best`  | **Recommended** — highest quality                                     |
| `qwen-3-coder`      | `code`  | Best alias for code-focused tasks                                     |
| `kimi-k2.6`         | `agent` | Best tool calling, 262K context                                       |
| `qwen-3-32b`        | `fast`  | Ultra-fast active coding model                                        |
| `deepseek-v4-pro`   | —       | 1M context, top reasoning. Complex refactors and long-codebase tasks. |
| `deepseek-v4-flash` | —       | 1M context, value tier. Everyday completions where speed matters.     |

```bash theme={null}
curl "https://kymaapi.com/v1/models/recommend?agent=opencode"
```

See all [model aliases](/guides/model-aliases) for shortcuts.

## Prompt Caching

Prompt caching is automatic. Your system prompt and tool definitions are cached for 5 minutes, reducing costs by up to 90% on subsequent requests. No code changes needed. See [Prompt Caching](/guides/prompt-caching) for details.
