OpenCode can configure OpenAI-compatible providers. After adding cheapkeyai.com to `opencode.json`, select the model in the UI or via command line.
Endpoint
https://cheapkeyai.com/v1
Installation
npm install -g opencode
brew install opencode-ai/tap/opencode
opencode --version
Configure opencode.json
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"cheapkeyai": {
"npm": "@ai-sdk/openai-compatible",
"name": "cheapkeyai.com",
"options": {
"baseURL": "https://cheapkeyai.com/v1"
},
"models": {
"gpt-5.2": { "name": "GPT-5.2" },
"gpt-5.3-codex": { "name": "GPT-5.3 Codex" },
"claude-sonnet-4-5": { "name": "Claude Sonnet 4.5" },
"claude-opus-4-5": { "name": "Claude Opus 4.5" }
}
}
}
}
Login and Select Model
opencode auth login
opencode
# In OpenCode, select cheapkeyai provider and the model to use.
Notes
- To avoid saving keys in configuration files, prefer environment variables or a secret store.
- The model name must match the model allowed for the key/group.
- After modifying config, restart OpenCode to ensure changes are applied.