Run Claude Code on a Cheaper API Endpoint at Half the Official Price (2026)
Point Claude Code at a cheaper Claude endpoint with two environment variables. Sonnet 5.5 at $1 / $5 and Opus 5.5 at $2 / $10 per million tokens, the Haiku-slot setting you must not skip, and a settings.json you can copy.

Updated 2026-10-10. Claude models on cloudgpu.app are currently available through Claude Code only (the CLI or its VS Code and JetBrains extensions). Calling them from Cursor, Cline, Continue, the OpenAI SDK, the OpenAI-compatible
/v1/chat/completionsendpoint or curl is not supported right now. The setup below is the way to use them.
Claude Code is a terminal agent: it reads your repository, edits files, runs commands and loops until the task is done. That loop is also why it is expensive on a pay-per-token key. Every step re-sends a large slice of your codebase as input, so a long session can burn through millions of input tokens before you notice.
Claude Code does not care where its requests go, as long as the endpoint speaks the Claude Messages API format. Point it at a cheaper endpoint and the tool behaves the same; only the bill changes. This guide shows how to do that with cloudgpu.app, which bills every Claude model at exactly half the official per-token price.
What Claude Code costs here, 8 October 2026
USD per 1M tokens. “Ours” is what you are billed from your prepaid balance; “official” is the published list price for the same model.
| Model | Input (ours / official) | Output (ours / official) |
|---|---|---|
| claude-opus-5-5 | $2.00 / $4.00 | $10.00 / $20.00 |
| claude-opus-5 | $2.50 / $5.00 | $12.50 / $25.00 |
| claude-sonnet-5-5 | $1.00 / $2.00 | $5.00 / $10.00 |
| claude-sonnet-5 | $1.00 / $2.00 | $5.00 / $10.00 |
| claude-sonnet-4-6 | $1.50 / $3.00 | $7.50 / $15.00 |
claude-opus-4-8, claude-opus-4-7 and claude-opus-4-6 are priced like claude-opus-5. claude-fable-5-1 and claude-fable-5 are $5.00 / $25.00 (official $10.00 / $50.00). There is no Haiku model. The live table on the /api page is authoritative if a number here ever drifts.
Step 1: get a key
- Sign up at cloudgpu.app with email or Google.
- Top up on the billing page. Alipay, Google Pay, Apple Pay, Visa and Mastercard work from $5 in one checkout, and USDT on TRC-20 is accepted. A first top-up of $10 or more gets a $5 bonus.
- Open the API console and create a key. It looks like
cgw-sk-....
Step 2: point Claude Code at the gateway
The quickest way is four environment variables in the shell you launch Claude Code from:
export ANTHROPIC_BASE_URL=https://cloudgpu.app
export ANTHROPIC_AUTH_TOKEN=cgw-sk-...
export ANTHROPIC_MODEL=claude-sonnet-5-5 # or claude-opus-5-5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=claude-sonnet-5-5
claude
What each one does:
- ANTHROPIC_BASE_URL is the bare host. Claude Code appends
/v1/messageson its own, so do not add/v1yourself. - ANTHROPIC_AUTH_TOKEN is your gateway key. Claude Code sends it as a bearer token.
- ANTHROPIC_MODEL is the main model for your session. Sonnet 5.5 is the sensible default; Opus 5.5 is twice the price and worth it for hard refactors and long agentic tasks.
- ANTHROPIC_DEFAULT_HAIKU_MODEL is the one people skip and then wonder why things break. Claude Code uses the Haiku slot for small background jobs. We do not serve a Haiku model, so without this line those calls ask for a model the gateway does not have. Mapping the slot to
claude-sonnet-5-5fixes it. Those background calls are then billed at Sonnet prices; they are small, but they are not free.
If you switch models mid-session with /model, you can also pin the aliases so they resolve to IDs the gateway serves:
export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-5-5
export ANTHROPIC_DEFAULT_SONNET_MODEL=claude-sonnet-5-5
Step 3: or make it permanent in settings.json
Exporting variables in every terminal gets old. Claude Code reads an env block from ~/.claude/settings.json and applies it to every session:
{
"env": {
"ANTHROPIC_BASE_URL": "https://cloudgpu.app",
"ANTHROPIC_AUTH_TOKEN": "cgw-sk-...",
"ANTHROPIC_MODEL": "claude-sonnet-5-5",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-sonnet-5-5"
}
}
If the file already exists, merge the env keys into it rather than replacing the file. A project-level .claude/settings.json works too, but never commit a file that contains your key; keep the key in your user-level settings or a gitignored local file.
Step 4: check it works
Run a one-shot prompt:
claude -p "Reply with the single word: ok"
Then open the API console and confirm the request appears in your usage. If it does, every Claude Code session from that machine is now billed through the gateway.
Common problems:
- 404 on every request: the base URL ends in
/v1. Remove it. - Auth errors: the token must be your
cgw-sk-...key. If you were signed in to Claude Code with another account before, run/logoutand start a new session so it picks up the environment variables. - Errors only on background tasks:
ANTHROPIC_DEFAULT_HAIKU_MODELis missing.
How to keep the bill small
Half price is the floor, not the whole saving. Claude Code spends most of its tokens on input, so the habits that cut input matter more than anything else:
- Default to Sonnet. Run most work on
claude-sonnet-5-5and switch to Opus with/modelonly for the task that needs it. The 2x gap between them is bigger than most other optimisations combined. - Clear context between tasks.
/clearwhen you move to something unrelated, instead of dragging a long history into the next task. - Scope the work. Point Claude Code at the directory or files that matter. A smaller working set is fewer tokens on every step.
- Watch the first day. Look at the usage page after a normal day of work, then decide how large a balance makes sense.
The honest trade-offs
This is a gateway, not a first-party Claude account, and you should know what that means before you move your daily workflow onto it.
- Not official. cloudgpu.app is independent and not affiliated with the model vendor. You get API access billed from a prepaid balance; vendor-account features such as their console, workspaces and their own rate-limit tiers are not part of it.
- No failover. The gateway runs in Hong Kong. There is no automatic failover today, so an outage stops your sessions until it recovers. We do not offer an SLA. If an outage would block you, keep a second way to run Claude Code configured.
- Privacy. Prompt and completion bodies are not stored. Token counts are kept for billing.
- Prices move. The numbers above are as of 8 October 2026. The /api page always shows the current ones.
If you mostly want Claude in an editor, use the Claude Code extension for VS Code or JetBrains with the same settings; Claude models do not work in Cursor, Cline or Continue right now. Claude in Cursor, Cline and Continue explains which models to use there instead. For a broader overview of the models and payment options, read Cheap Claude API access with Alipay and no US card.
Start small
Don’t load a big balance on day one. Make the smallest first top-up that suits you ($10 also unlocks the $5 bonus), run a normal day of Claude Code on Sonnet, check the usage page, and only then decide how much to keep on the account. Balance is prepaid and does not expire, so nothing is lost by starting small. Create your key at cloudgpu.app/api.
Try cloudgpu.app — no credit card required
No credit card required. Per-minute billing, deploy in 60 seconds.