Skip to main content
Connect OpenCode using its custom provider support and the OpenAI-compatible Chat Completions adapter.

Prerequisites

The npm installation is:

Supply the API key

Start OpenCode from this terminal so the process can read the variable.

Add a custom provider

Create opencode.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:
Run /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.
Last modified on September 23, 2026