OpenCode Setup Guide
Add UnoRouter as a custom provider in OpenCode and pick any model as the active coding agent.
Overview
OpenCode reads its providers from a JSON config file. Add UnoRouter as a custom provider with the OpenAI-compatible adapter and you can pick any UnoRouter model as the active model.
Quick Config
Drop these values into the client. Your key auto-fills when you are signed in.
Base URL: https://api.unorouter.ai/v1
API Key: YOUR_API_KEYCompatibility
Step-by-step setup
- 1Open the OpenCode config file
Press Ctrl + O inside OpenCode and paste the path. On Windows, replace YOUR_USER with your Windows username.
textC:/Users/YOUR_USER/.config/opencode/opencode.json - 2Replace the file contents
Wipe the file and paste the UnoRouter provider block. Drop in your UnoRouter API key and pick any model from the catalog.
json{ "$schema": "https://opencode.ai/config.json", "provider": { "unorouter": { "name": "UnoRouter", "npm": "@ai-sdk/openai-compatible", "options": { "apiKey": "YOUR_API_KEY", "baseURL": "https://api.unorouter.ai/v1" } } } } - 3Save and reload
Press Ctrl + S to save, then Ctrl + Shift + P and run Developer: Reload Window. OpenCode picks up the new provider on reload.
- 4Pick a model
Open the model picker in OpenCode and switch to the model you added. The OpenAI-compatible adapter handles streaming and tool calling automatically.
Recommended models
Free models that work well here. Paste any model id into the client.
Gotchas
- OpenCode uses the npm @ai-sdk/openai-compatible adapter under the hood, so you can keep adding models under "models" without restarting.
- If Developer: Reload Window does not show your provider, double check the JSON saved without trailing commas.
- Use exact model ids from the UnoRouter catalog. Strip any leading provider prefix if a copy-paste added one.