OpenCode
OpenCode (terminal and desktop) reads provider configuration from opencode.json, using the @ai-sdk/openai-compatible package for any custom OpenAI-compatible endpoint — the same config file works for both the CLI and the desktop app. Add Tempr once and every model on your allowlist — Claude, GPT, Gemini — shows up under it, all through one key.
-
Create a virtual key
In the Portal, create a Gateway virtual key. Keys are prefixed
tvk_and shown once at creation. -
Add a provider key
Gateway is BYOK: add a key for at least one provider from the supported list.
-
Add Tempr as a provider
Create or edit
opencode.json(project root or~/.config/opencode/opencode.json):
{
"provider": {
"tempr": {
"npm": "@ai-sdk/openai-compatible",
"name": "Tempr Gateway",
"options": {
"baseURL": "https://api.temprhq.io/v1",
"apiKey": "tvk_..."
},
"models": {
"anthropic/claude-sonnet-4-5": {
"name": "Claude Sonnet 4.5 (via Tempr)"
}
}
}
}
}
Model ids
Add one entry per model under models, keyed by the fully-qualified provider/model form (e.g. anthropic/claude-sonnet-4-5, openai/gpt-5) — the same ids GET /v1/models returns.
What's next
- Authentication & virtual keys — scoping keys with model allowlists, budgets, and rate limits.
- Models, limits & logs — request logs and analytics for everything you send through the gateway.