CheapAI

Documentation

Everything you need to plug CheapAI into your tooling — setup guides for popular agents, API reference, FAQ.

OpenCode

Open-source terminal agent

Create an API key on the Keys page and copy it.

Install OpenCode:

bash
npm install -g opencode-ai

Add the provider to opencode.json (project root, or global ~/.config/opencode/opencode.json):

json
{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "cheapai": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "CheapAI",
      "options": {
        "baseURL": "https://cheapai.io/v1",
        "apiKey": "{env:CHEAPAI_API_KEY}"
      },
      "models": {
        "claude-opus-4-8": { "name": "Claude Opus 4.8" },
        "gpt-5.6-sol": { "name": "GPT-5.6 Sol" }
      }
    }
  }
}

Add any models you need from the catalog to the models map.

Export your key (macOS / Linux — add to ~/.zshrc for persistence):

bash
export CHEAPAI_API_KEY="YOUR_API_KEY"

Run opencode, then /models — pick a model under CheapAI.

Replace YOUR_API_KEY with a real key from the Keys section.