OpenCode (gateway)
Route OpenCode’s LLM calls through the Respan gateway for automatic logging, caching, and model switching. Only your RESPAN_API_KEY is needed.
Setup
Switch models
Change the -m flag to use 1000+ models from different providers through the same gateway.
OpenCode validates model IDs against its own catalog for the built-in openai provider, so only OpenAI model names work behind the openai/ prefix. For Claude, Gemini, and other providers, add Respan as a custom provider as shown below.
See the full model list.
Use any gateway model with a custom provider
Add a respan provider to ~/.config/opencode/opencode.json (or opencode.json in your project). Any model ID the gateway exposes can be listed here:
Export the key and run with the respan/ prefix: