Skip to main content

Supported Providers

ProviderAuth methodNotes
AnthropicAPI keyClaude models
OpenAIAPI keyGPT models
GoogleAPI key / OAuthGemini models
GitHub CopilotOAuthRequires GitHub Copilot subscription
GroqAPI keyFast inference
DeepSeekAPI keyCost-effective
MistralAPI keyOpen-weight models
xAIAPI keyGrok models
OpenRouterAPI keyMulti-provider gateway
Amazon BedrockAPI keyAWS-hosted models
OpenCodeNoneFree tier models

Free Models

These models work without any API key:
ModelReasoningTool calling
MinimixNoYes
GLM5NoYes
KimiK2.5YesYes

Setting Up a Provider

1

Open Settings

Navigate to Settings in the sidebar.
2

Select provider

Choose your provider from the list.
3

Enter API key

Paste your API key. It is stored locally via OpenCode’s configuration.
Via API:
curl -X POST http://localhost:3001/api/opencode/auth \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"providerId": "anthropic", "apiKey": "sk-ant-..."}'

Model Selection

Select which model to use for execution:
  1. Open the Model Selector dropdown in the project config panel (top of the kanban board)
  2. Browse connected providers and their available models
  3. Select a model — it applies to all subsequent executions
Via API:
curl -X POST http://localhost:3001/api/opencode/config/model \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <token>" \
  -d '{"model": "anthropic/claude-sonnet-4-20250514"}'
Get current model:
curl http://localhost:3001/api/opencode/config \
  -H "Authorization: Bearer <token>"

Permission System

During execution, the AI agent may request permission to use certain tools (e.g., executing shell commands, writing files). These appear as permission requests in the task detail view.

Permission Responses

ResponseEffect
onceAllow this specific action once
alwaysAlways allow this type of action
rejectDeny the action

Responding to Permissions

In the UI, permission requests appear as actionable cards in the task detail view. Via API:
curl -X POST http://localhost:3001/api/tasks/:id/permissions/:permissionId/respond \
  -H "Content-Type: application/json" \
  -d '{"response": "once"}'

Provider Status

Check which providers are connected:
curl http://localhost:3001/api/opencode/setup-status \
  -H "Authorization: Bearer <token>"
Returns:
{
  "providers": [
    {"id": "anthropic", "name": "Anthropic", "authenticated": true},
    {"id": "openai", "name": "OpenAI", "authenticated": false},
    {"id": "opencode", "name": "OpenCode", "authenticated": true}
  ],
  "ready": true
}
The ready field is true when at least one provider is authenticated.