- Docs
- Coding tools
- OpenCode
Use OpenCode with Airoutly
Add Airoutly as an OpenAI-compatible provider in opencode.json. Every chat model on Airoutly works through it.
- Base URL
https://api.airoutly.com/v1- Key variable
AIROUTLY_API_KEY- Models
- Any chat model on the models page
1. Install OpenCode
curl -fsSL https://opencode.ai/install | bashnpm install -g opencode-ai# OpenCode recommends running it in WSL; natively:
scoop install opencode2. Add the provider
Add Airoutly to ~/.config/opencode/opencode.json (all projects) or opencode.json in a project root. The two files are merged.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"airoutly": {
"npm": "@ai-sdk/openai-compatible",
"name": "Airoutly",
"options": {
"baseURL": "https://api.airoutly.com/v1",
"apiKey": "{env:AIROUTLY_API_KEY}"
},
"models": {
"claude-sonnet-4-5": { "name": "Claude Sonnet 4.5" },
"gpt-5": { "name": "GPT-5" }
}
}
},
"model": "airoutly/claude-sonnet-4-5"
}Each key under models must be the exact model ID from the models page.
3. Choose a model
model sets the default as airoutly/<model-id>. Inside OpenCode, run /models to switch.
Troubleshooting
401 even though the key is right
If AIROUTLY_API_KEY isn’t set, {env:AIROUTLY_API_KEY} becomes an empty string without any warning. Export the variable in the shell that starts OpenCode.
Check the setup from the command line
Run opencode models airoutly to list the models, then opencode run -m airoutly/gpt-5 “hi”.