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

# OpenCode

> Configure OpenCode with Prism as an OpenAI-compatible provider.

## Copy for your agent

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
Follow https://docs.prisminference.com/guides/opencode to configure Prism in my
global OpenCode settings. Preserve unrelated settings and never repeat my API
key to me or include it in your response.
```

If no key exists, follow [Agent signup](/guides/agent-signup) first.

## Configure

Merge this into `~/.config/opencode/opencode.json`:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "$schema": "https://opencode.ai/config.json",
  "model": "prism/deepseek-v4.1-flash",
  "small_model": "prism/deepseek-v4.1-flash",
  "provider": {
    "prism": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Prism",
      "options": {
        "baseURL": "https://api.prisminference.com/v1"
      },
      "models": {
        "deepseek-v4.1-flash": {
          "name": "DeepSeek-V4.1-Flash",
          "attachment": true,
          "reasoning": true,
          "tool_call": true
        },
        "deepseek-v4-flash": {
          "name": "DeepSeek-V4-Flash",
          "reasoning": true,
          "tool_call": true
        }
      }
    }
  }
}
```

OpenCode adds the first `prism/` as its local provider ID and sends the bare
model ID to Prism.

## Connect

Start OpenCode and run `/connect`. Select **Other**, enter `prism` as the
provider ID, then enter your Prism API key. OpenCode stores the credential in
its native auth store.

Do not inspect the auth store or run `opencode debug config`, which can print
resolved secrets.

## Verify

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
opencode models prism
```
