OpenCode

Override OpenCode's OpenAI provider to reach LLMRPM.

Configuration

SettingValue
API shapeOpenAI-compatible
Base URLhttps://llmrpm.com/api/v1
AuthAuthorization: Bearer llmrpm_...
  • Place the config in ~/.config/opencode/opencode.json or the project opencode.json.
  • Override the OpenAI provider baseURL with https://llmrpm.com/api/v1.
  • Set model to openai/<public-model-id>.
  • Set small_model to 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 --refresh

Troubleshooting

SymptomCause & fix
Authentication errorCheck that the API key has no extra spaces and has not been revoked in the dashboard.
Model rejectedUse a public model ID returned by GET /api/v1/models; do not use display names or aliases.
Connection issueConfirm 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.