OpenCode

OpenCode routes through the AI SDK's @ai-sdk/openai-compatible adapter, so Nimbus plugs in as a first-class provider. Every Nimbus model shows up in the picker alongside built-ins.

OpenCode's opencode.json supports custom providers through the provider key. Point one at Nimbus and declare which models you want the picker to expose — each entry can flag multimodal input, tool calling, and reasoning support so OpenCode routes the right UI.

Prerequisites

  • OpenCode 0.4+ (older versions used a different provider schema).
  • A Nimbus API key (sk-nim-...).
  • An opencode.json at your project root or ~/.config/opencode/opencode.json for the global config.

Install

OpenCode ships the adapter package in its bundle — nothing to install.

bash
npm i -g opencode-ai

Configure

Drop this into opencode.json. Add as many entries under models as you want in the picker.

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "nimbus": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Nimbus",
      "options": {
        "baseURL": "https://llm.nimbusapi.net/v1",
        "apiKey": "sk-nim-..."
      },
      "models": {
        "anthropic/claude-opus-4.8": {
          "attachment": true,
          "tool_call": true,
          "reasoning": true,
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "anthropic/claude-sonnet-4.6": {
          "attachment": true,
          "tool_call": true,
          "reasoning": true,
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        },
        "openai/gpt-5.1": {
          "attachment": true,
          "tool_call": true,
          "reasoning": true,
          "modalities": { "input": ["text", "image"], "output": ["text"] }
        }
      }
    }
  }
}

For local dev, drop the key into an env var instead of the JSON. OpenCode expands ${env:NAME} at load time:

json
"apiKey": "${env:NIMBUS_API_KEY}"

First call

Start OpenCode from the project root:

bash
opencode

Open the model picker (/model) — you should see a Nimbus group with every entry you declared. Pick one and type a prompt; the request hits llm.nimbusapi.net/v1/chat/completions and streams back through the adapter. Confirm it landed by checking the Nimbus dashboard's live Requests view.

Troubleshooting

  • "Provider Nimbus not found": opencode.json is invalid — a trailing comma or unescaped backslash. Run jq . opencode.json to confirm it parses.
  • Model picker is empty for Nimbus: you forgot the models map. OpenCode does not auto-discover from /v1/models — every model you want must be declared explicitly.
  • 401 Unauthorized: apiKey still contains the literal sk-nim-... placeholder, or the ${env:...} variable is unset in the shell you launched OpenCode from.
  • Reasoning UI missing: the model entry omits "reasoning": true. OpenCode gates the collapsed-thoughts panel on that flag.
  • Image attachments rejected: the model entry omits "attachment": true or the modalities.input array doesn't include "image". Fix the entry and reload — see Images for the wire format Nimbus expects.