Sovereign Docs

OpenCode

Connect OpenCode to Sovereign using a custom OpenAI-compatible provider.

Official docs:

Use the OpenAI-compatible surface:

Base URL: https://api.sovrun.one/v1
Model:    sovereign-alpha

Setup

  1. Run /connect.
  2. Choose Other.
  3. Enter a provider ID such as sovereign.
  4. Paste your API key.
  5. Add the provider to opencode.json.

Example opencode.json

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "sovereign": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "Sovereign",
      "options": {
        "baseURL": "https://api.sovrun.one/v1"
      },
      "models": {
        "sovereign-alpha": {
          "name": "Sovereign Alpha"
        }
      }
    }
  }
}

Notes

  • OpenCode's docs recommend @ai-sdk/openai-compatible for providers that expose /v1/chat/completions.
  • If you build a custom flow around /v1/responses, OpenCode also documents switching to @ai-sdk/openai.

On this page