Prerequisites
- Install OpenCode from its official installation guide.
- Create an active API key in the RunBridge AI dashboard.
- Choose an exact model ID that supports Chat Completions, streaming, and tool calling. Replace
your-model-idbelow.
Supply the API key
- Bash / Zsh
- PowerShell
Add a custom provider
Createopencode.json in your test project, or merge this into your existing configuration. For a configuration shared across your projects, use ~/.config/opencode/opencode.json.
runbridge is a custom provider ID, not a built-in provider. The models key is the exact model ID sent to the API; name only controls its display label. Keep the base URL at /v1 because the adapter appends /chat/completions.
OpenCode substitutes {env:RUNBRIDGE_API_KEY} at runtime. Keep that reference in the file instead of putting a secret into a project configuration. If you add context or output limits, use the chosen model’s documented values rather than copying another model’s limits.
This guide uses Chat Completions. For a Responses-only model, OpenCode documents the separate
@ai-sdk/openai adapter. Select an adapter that matches the model’s API format before using it.Verify the connection
Start OpenCode in the directory containing your configuration:/models and select the RunBridge AI model. Ask: Reply with “RunBridge connected” without running commands or changing files. Check the request in the RunBridge AI usage records. Then verify tool calling in a disposable project before using the agent on real work.
Troubleshooting
See the official custom provider and configuration documentation.