Cheat sheet
One table, every client. Find your tool, copy the address and the key variable, read the note. Your key starts with ck_ and lives in the dashboard.
| What you run | Base URL | Key variable | Notes |
|---|---|---|---|
| Claude Code (macOS / Linux) | https://api.cheapapirelay.com | export ANTHROPIC_BASE_URL=https://api.cheapapirelay.com export ANTHROPIC_AUTH_TOKEN=ck_paste_key_here claude | No /v1 on this address. Claude models only answer the official Claude Code and Claude Desktop clients, version 2.1.285 or newer; that is an upstream rule we cannot lift. |
| Claude Code (Windows) | https://api.cheapapirelay.com | setx ANTHROPIC_BASE_URL https://api.cheapapirelay.com setx ANTHROPIC_AUTH_TOKEN ck_paste_key_here | setx keeps both values for new terminals: open a fresh PowerShell window afterwards, then start claude. |
| Claude Desktop | https://api.cheapapirelay.com | ANTHROPIC_BASE_URL=https://api.cheapapirelay.com ANTHROPIC_AUTH_TOKEN=ck_paste_key_here | The same two values as Claude Code, entered in the app's gateway settings. The same client-version rule applies. |
| Codex CLI | https://api.cheapapirelay.com/v1 | export CHEAP_KEY=ck_paste_key_here | Add a custom provider that points at /v1 and let Codex read the key from CHEAP_KEY. Every GPT model on the price list works.# ~/.codex/config.toml model = 'gpt-6.1-sol' model_provider = 'cheaprelay' [model_providers.cheaprelay] name = 'CheapRelay' base_url = 'https://api.cheapapirelay.com/v1' env_key = 'CHEAP_KEY' wire_api = 'responses' # then: export CHEAP_KEY=ck_paste_key_here |
| OpenAI SDK (Python, Node) | https://api.cheapapirelay.com/v1 | api_key="ck_paste_key_here" | Any OpenAI-compatible SDK works once base_url ends in /v1. Sensible GPT ids to start with: gpt-6.1-sol, gpt-6-astra, gpt-5.6-sol.from openai import OpenAI as BudgetClient
wallet = BudgetClient(base_url="https://api.cheapapirelay.com/v1", api_key="ck_paste_key_here")
bill = wallet.chat.completions.create(
model="gpt-6.1-sol",
messages=[{"role": "user", "content": "List three habits that waste tokens"}],
)
print(bill.choices[0].message.content)
print("tokens billed:", bill.usage.total_tokens) |
| cURL | https://api.cheapapirelay.com/v1/chat/completions | -H "Authorization: Bearer ck_paste_key_here" | Chat completions answer at /v1/chat/completions; the /v1/responses route is relayed as well.curl https://api.cheapapirelay.com/v1/chat/completions \
-H "Authorization: Bearer ck_paste_key_here" -H "Content-Type: application/json" \
-d '{"model":"gpt-6.1-sol","messages":[{"role":"user","content":"Price check: one tip to trim a prompt"}]}' |
| Gemini CLI | https://api.cheapapirelay.com | export GOOGLE_GEMINI_BASE_URL=https://api.cheapapirelay.com export GEMINI_API_KEY=ck_paste_key_here gemini | Bare domain only. Leave /v1beta off; the CLI adds it by itself. |
| Gemini REST | https://api.cheapapirelay.com/v1beta/models/{model}:generateContent | -H "x-goog-api-key: ck_paste_key_here" | Gemini speaks its native protocol here and never /v1/chat/completions. Stream with :streamGenerateContent?alt=sse. Ids on sale: gemini-2.5-flash, gemini-3.1-pro, gemini-3.8-flash.curl "https://api.cheapapirelay.com/v1beta/models/gemini-3.8-flash:generateContent" \
-H "x-goog-api-key: ck_paste_key_here" -H "Content-Type: application/json" \
-d '{"contents":[{"role":"user","parts":[{"text":"Sum up prompt caching in twelve words"}]}]}' |
| Cursor, Cline, Roo, Cherry Studio, OpenCode | https://api.cheapapirelay.com/v1 | the app's own API-key box | Choose the OpenAI-compatible provider and paste the key. GPT, DeepSeek, Kimi, GLM, Qwen, Grok and MiniMax all work through it; Claude does not, because it needs the official clients. |
Billing: each call is priced by its real token counts (input, output, cache write, cache read) and is listed in the dashboard right after it ends.
HTTP 402 means the balance is at or under zero: top up and the same key works again. 401 is a missing or voided key; 429 means slow down (120 calls a minute per key, 8 at once per account).
Model ids your key can use: GET /v1/models in OpenAI format, GET /v1beta/models for the Gemini ones.