opencode

Fixture onlyChecked 16 November 2026

In short

  • The exact settings for this tool.
  • Set the base URL and a Petrova key.
  • Caps and receipts work with no extra setup.

Base URL with /v1 (opencode uses the AI SDK Anthropic provider).

Add to opencode.json (project) or ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "petrova": {
      "npm": "@ai-sdk/anthropic",
      "name": "Petrova",
      "options": {
        "baseURL": "http://127.0.0.1:4100/v1",
        "apiKey": "{env:PETROVA_API_KEY}"
      },
      "models": {
        "claude-opus-5-5": { "name": "Claude Opus 5.5 (Petrova)" },
        "claude-fable-5-1": { "name": "Claude Fable 5.1 (Petrova)" },
        "claude-sonnet-5-5": { "name": "Claude Sonnet 5.5 (Petrova)" },
        "claude-haiku-5-5": { "name": "Claude Haiku 5.5 (Petrova)" }
      }
    }
  },
  "model": "petrova/claude-opus-5-5"
}
export PETROVA_API_KEY=ptrv_test_...
opencode

Once the models.dev listing (draft in integrations/models.dev/) is merged, Petrova shows up in opencode's provider list and only the key is needed.

Last checked against the code: 16 November 2026. Something wrong? The source of this page is in the repository, so a fix is one edit.