Tools & IDEs

Configure OpenCode

Setup OpenCode with the OpenAI-compatible provider of cheapkeyai.com via opencode.json.

OpenCode can configure OpenAI-compatible providers. After adding cheapkeyai.com to `opencode.json`, select the model in the UI or via command line.

Endpoint

Base URL
https://cheapkeyai.com/v1

Installation

npm or brew
npm install -g opencode
brew install opencode-ai/tap/opencode
opencode --version

Configure opencode.json

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

Commands
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.