Claude Code setup on 59API: FAQ for Claude users
Why does Claude Code need a different setup?
You have Claude Code open, you have a 59API key, and something still fails. That is usually not a billing problem. It is a client problem.
Claude models on 59API work only through the genuine Claude Code or Claude Desktop client, version 2.1.285 or newer. They do not work through the OpenAI SDK, cURL, Codex, Cursor, Cherry Studio, Cline, OpenCode or any other client. If you send a Claude request from one of those, you are asking the wrong protocol of the wrong host, and the answer will be an error rather than a completion.
That constraint is a common source of confusion in Claude Code setup, so it is worth stating plainly: 59API is an independent third-party AI API relay, not an official Anthropic channel. It gives you one account, one API key and one API host, https://api.59api.com, for Claude, GPT, Gemini, DeepSeek and other models. You are not changing how Claude Code works; you are pointing the same client at a different endpoint.
Once the client is right, the money side is straightforward. 59API uses a prepaid balance, charged per request by real token usage. There is no monthly fee, and your balance never expires. Monthly and weekly cards are optional. That means you can top up the smallest amount, ¥10, and start working, then decide later whether a card makes sense for heavier usage.
How do I point Claude Code at 59API?
Two environment variables do the work. Set ANTHROPIC_BASE_URL=https://api.59api.com and ANTHROPIC_AUTH_TOKEN=YOUR_59API_KEY, then start Claude Code or Claude Desktop. Use version 2.1.285 or newer, and replace YOUR_59API_KEY with your real key.
That is the whole setup. There is no separate Claude-specific host, no second account, and no monthly subscription to configure. The same key and host serve the rest of the catalogue: Codex, OpenAI SDKs, cURL and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode use base_url https://api.59api.com/v1 with the chat endpoint https://api.59api.com/v1/chat/completions, for GPT, DeepSeek and other non-Claude, non-Gemini models only. Gemini CLI has its own native path, GOOGLE_GEMINI_BASE_URL=https://api.59api.com with GEMINI_API_KEY=YOUR_59API_KEY, because Gemini models use Google's native protocol and are not OpenAI-compatible.
Before your first request, fund the account. Top-ups are ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, and invoices are available. Billing is in CNY, with USD figures shown at ¥7.2 = $1. Since 59API charges by real token usage, there is no need to guess a monthly budget in advance: you top up, you use, you top up again.
What does a Claude request cost on 59API?
All rates below are per 1 million tokens, and billing is in CNY. USD figures are shown at ¥7.2 = $1.
- Claude Sonnet 5.5 (model id claude-sonnet-5-5): input $1.11 (¥8), output $5.56 (¥40), cache read $0.0972 (¥0.7).
- Claude Opus 5.5 (model id claude-opus-5-5): input $1.53 (¥11), output $7.22 (¥52), cache read $0.0694 (¥0.5).
- Claude Haiku 4.5 (model id claude-haiku-4-5-20251001): input $0.3472 (¥2.5), output $1.67 (¥12), cache read $0.0278 (¥0.2).
Read that as three levers. Output tokens cost the most in every case, because one request can generate far more output than input. Input is priced lower but still adds up on long context. Cache reads are priced lower again, so repeated context costs less per token than fresh input.
For comparison, the official list price is $2 / $10 for Sonnet 5.5, $4 / $20 for Opus 5.5 and $1 / $5 for Haiku 4.5. Official list price is only a reference point: 59API is an independent relay and charges the rates shown above.
Because you are billed on actual usage rather than a seat, the practical move is to keep the habits you already have. Pick the model that fits the task, watch token volume in your own workflow, and let the balance follow usage instead of a fixed monthly charge.
What does a full session cost?
Here are three hypothetical workloads, priced without cache.
- Claude Sonnet 5.5, 3M input + 0.5M output tokens: $6.11 (¥44) on 59API. At official list price $11 (about ¥79.2), that is about 56% of list price.
- Claude Opus 5.5, 2M input + 0.5M output tokens: $6.67 (¥48) on 59API. At official list price $18 (about ¥129.6), that is about 37% of list price.
- Claude Haiku 4.5, 5M input + 1M output tokens: $3.4 (¥24.5) on 59API. At official list price $10 (about ¥72), that is about 34% of list price.
The pattern is worth noting. The heavier the share of output in the workload, the lower the multiple against list price, because the output rates sit well below the official reference. The Haiku example is the clearest case: long input, heavy output, and still about a third of the reference price.
None of these numbers require a subscription decision. You top up ¥10, ¥50, ¥100, ¥200, ¥500 or ¥1000, and the balance is spent down by real token usage. If a session goes badly, you have not committed to a month of fees. If it goes well, you top up again and keep going.
That is the argument for prepaid balance in one sentence: it turns an unpredictable engineering workload into a number you can check, because every request is metered and every top-up is visible.
Should you use a Claude card or prepaid balance?
Both work. The balance is the default and needs no commitment. Cards exist when you want a fixed 30-day or 7-day allowance for one model family.
For example, the C-PRO Entry card for Claude covers 30 days at $83.19 (¥599), with quota $610 and a weekly cap of $230. The C-MAX Standard card for Claude covers 30 days at $319.31 (¥2299), with quota $2350. Quota and caps are card metering units written in $, not official list-price dollars, so do not convert them into official prices. Both drain at the card's metering price × 2.4, and the reference value at official list prices is about $169.44 (¥1220) for the C-PRO Entry card and about $652.78 (¥4700) for the C-MAX Standard card.
Two rules catch people out. A card has its own key, can only call that family's models, and is paid only from the card: it never falls back to wallet balance, and a balance key never draws on a card. Unused quota does not roll over. So a card is a separate lane, not a discount layered on top of your prepaid balance.
For most Claude Code users, start with prepaid balance: one key, one host, per-request billing, no expiry. Add a Claude card later if you want a predictable allowance and a dedicated key for a heavier 30-day stretch.
Pronto para começar?
Uma só chave para Claude, GPT e outros, com cobrança por tokens reais e sem mensalidade. Cadastre-se para criar sua chave API; as tarifas de cada modelo estão na página de preços.
Cadastro grátis Preços