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

# OpenCode

> Add nemonist as a provider in OpenCode.

**1. Add a nemonist provider**

Add a nemonist provider to `opencode.json` in your project, or to `~/.config/opencode/opencode.json` for every project:

```json theme={null}
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "nemonist": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "nemonist",
      "options": {
        "baseURL": "https://nemonist.com/api/v1",
        "apiKey": "{env:NEMONIST_API_KEY}"
      },
      "models": {
        "anthropic/claude-sonnet-5.5": {},
        "openai/gpt-5.5": {}
      }
    }
  }
}
```

Add any model ID from the [model list](https://nemonist.com/models) under `models`.

**2. Put your key in your shell profile**

```bash theme={null}
export NEMONIST_API_KEY="sk-nm-..."
```

**3. Start OpenCode**

Start `opencode` and choose a nemonist model with `/models`.

> [!WARNING]
>
> OpenCode runs a background service that keeps the config and environment it started with. After you edit `opencode.json` or change your key, run `opencode service restart`, or run once with `opencode run --standalone`. Otherwise OpenCode keeps the old settings and may answer "Model unavailable".


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