CheapAI

Documentation

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

Claude Code

Official Anthropic CLI

Create an API key — Keys page → click Create key, name it (e.g. claude-code), copy the key. We won't show the plaintext again.

Install Node.js 18+ first (it bundles npm) — nodejs.org/download. Check with node -v. Then install Claude Code:

bash
npm install -g @anthropic-ai/claude-code

Check that it installed: claude --version.

On macOS / Linux — add env vars to your shell rc (~/.bashrc or ~/.zshrc) and reload (source ~/.zshrc):

bash
export ANTHROPIC_BASE_URL="https://cheapai.io"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"

On Windows PowerShell — set them for the current session:

powershell
$env:ANTHROPIC_BASE_URL = "https://cheapai.io"
$env:ANTHROPIC_AUTH_TOKEN = "YOUR_API_KEY"

For a permanent setup add them via [System.Environment]::SetEnvironmentVariable(...) or System Properties → Environment Variables.

Alternative — per-project via .claude/settings.json (no global env needed):

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://cheapai.io",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY"
  }
}

In the project folder run claude — and ask a simple question (e.g. «what files are here?»). If you see a response, the integration works.

bash
claude

Optional — pin specific model versions. By default Claude Code uses the latest alias, which may resolve to a model not yet enabled on our gateway when Anthropic releases an update. Pin versions explicitly to control when your agent moves to a new model — set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL:

bash
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-6"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5"

Or add them to .claude/settings.json under env alongside ANTHROPIC_BASE_URL. Check the current catalog on the Models page — pin to an ID that actually exists.

Replace YOUR_API_KEY with a real key from the Keys section.