OpenCode
Override OpenCode's OpenAI provider to reach LLMRPM.
Configuration
| Setting | Value |
|---|---|
| API shape | OpenAI-compatible |
| Base URL | https://llmrpm.com/api/v1 |
| Auth | Authorization: Bearer llmrpm_... |
- Place the config in
~/.config/opencode/opencode.jsonor the projectopencode.json. - Override the OpenAI provider
baseURLwithhttps://llmrpm.com/api/v1. - Set
modeltoopenai/<public-model-id>. - Set
small_modelto a cheaper/faster model for lightweight work.
Example
opencode.json
{
"provider": {
"openai": {
"options": {
"baseURL": "https://llmrpm.com/api/v1",
"apiKey": "llmrpm_YOUR_KEY",
"timeout": 600000
}
}
},
"model": "openai/claude-sonnet-5",
"small_model": "openai/claude-haiku-4.5"
}Shell
export OPENAI_API_KEY="llmrpm_YOUR_KEY"
opencode auth login
opencode models --refreshRecommended models
Any public ID from the model list works. Common picks:
claude-sonnet-5— strong model for reasoning, refactors, and coding agents.claude-haiku-4.5— fast option for autocomplete, small questions, and lightweight tasks.deepseek-v4-pro— alternative based on your active catalog and plan.
Troubleshooting
| Symptom | Cause & fix |
|---|---|
| Authentication error | Check that the API key has no extra spaces and has not been revoked in the dashboard. |
| Model rejected | Use a public model ID returned by GET /api/v1/models; do not use display names or aliases. |
| Connection issue | Confirm the configured base URL is exactly the one shown above and that your network allows HTTPS to llmrpm.com. |
Notes
- Run opencode auth login if your local setup stores credentials separately.
- Run opencode models --refresh if the model list is cached.
- Use the openai/ prefix when OpenCode expects a provider/model name.