Skip to main content

What is OpenCode

OpenCode is an open-source AI coding agent available as a terminal interface, desktop app, and IDE extension. With provider configuration, it can send supported model requests through Capriole AI’s OpenAI-compatible and Anthropic-compatible endpoints.

Prerequisites

Before you begin, make sure you have:

Installation

Install OpenCode with the official install script:
Or install it with npm:
Verify the install:

Configuration

Create or update ~/.config/opencode/opencode.json: Use apiKey for the OpenAI and OpenAI-compatible providers and authToken for the Anthropic provider.

Run OpenCode

After replacing YOUR_CAPRIOLE_AI_API_KEY in the config, start OpenCode:
Use /models to select OpenAI latest, GPT 5.6 Thinking, GPT 5.6, GPT 5.5, GPT 5.4 mini, Fable 5, Opus 5, Grok 4.5, GLM 5.2, Kimi K3, Claude latest, Opus 4.8, Opus 4.7, Opus 4.6, or Sonnet 4.6. Use Ctrl+T to cycle model variants.

Supported models

OpenCode supports OpenAI latest, GPT 5.6 Thinking, GPT 5.6, GPT 5.5, GPT 5.4 mini, Fable 5, Opus 5, Grok 4.5, GLM 5.2, Kimi K3, Claude latest, Opus 4.8, Opus 4.7, Opus 4.6, and Sonnet 4.6 through Capriole AI. Fable 5 and Opus 5 can use either the Chat Completions-compatible provider or the Anthropic Messages provider.
  • openai-latest
  • openai/gpt-5.6-terra
  • openai/gpt-5.6-luna
  • openai/gpt-5.5
  • openai/gpt-5.4-mini
  • anthropic/claude-fable-5
  • anthropic/claude-opus-5
  • xai/grok-4.5
  • zai/glm-5.2
  • moonshot/kimi-k3
  • claude-latest
  • claude-fable-5
  • claude-opus-5
  • claude-opus-4-8
  • claude-opus-4-7
  • claude-opus-4-6
  • claude-sonnet-4-6

Troubleshooting

Why does OpenCode return an authentication error?

Confirm that both apiKey and authToken in ~/.config/opencode/opencode.json use your Capriole AI API key instead of YOUR_CAPRIOLE_AI_API_KEY.

Why do GPT requests fail?

Confirm that the GPT provider uses npm: "@ai-sdk/openai" and baseURL: "https://api.caprioletech.com/v1" so requests use the Responses API.

Why do Grok, GLM, or Kimi requests fail?

Confirm that capriole-ai-compatible uses npm: "@ai-sdk/openai-compatible" and baseURL: "https://api.caprioletech.com/v1" so both models use Chat Completions.

Why do Anthropic requests fail?

Confirm that the Anthropic provider uses npm: "@ai-sdk/anthropic", authToken, and baseURL: "https://api.caprioletech.com/v1".

Why don’t Capriole AI models appear?

Confirm that the model reference uses <providerId>/<modelId>, such as capriole-ai-openai/openai-latest, capriole-ai-compatible/moonshot/kimi-k3, or capriole-ai-anthropic/claude-latest, and that enabled_providers includes the Capriole AI providers while disabled_providers does not block them.

Why don’t model variants appear?

Confirm that you restarted OpenCode after updating ~/.config/opencode/opencode.json, then open /models and press Ctrl+T to cycle variants.

Why don’t config changes apply?

Check for project-level opencode.json or OPENCODE_CONFIG overrides, then restart OpenCode.

Why do provider initialization or provider package errors appear?

For ProviderInitError, verify the provider config first. For provider package errors, clear ~/.cache/opencode and restart OpenCode so provider packages are reinstalled.

Notes