Claude Code on 59API: pay-as-you-go token costs by model
Why the token bill feels unpredictable
If you run Claude Code every day, the number that actually decides your budget is not the plan you remember signing up for. It is the tokens your prompts consume, the tokens the model writes back, and the cache reads in between. That is why a single afternoon of refactoring can cost more than a week of small edits, and why developers keep asking for a way to see the number before the money is gone.
59API turns that uncertainty into a rate you can read. It is an independent third-party AI API relay, and it bills per request based on real token usage. There is no monthly fee, your prepaid balance never expires, and monthly or weekly cards are optional rather than required. Instead of committing to a fixed plan and hoping you use it, you top up and pay for exactly what the model processed.
This article works through Claude Code costs on 59API token by token, using the published rates for a few Claude models and the kind of hypothetical workloads you would actually run. Every number below comes straight from the 59API rate sheet. Prices are per 1 million tokens, billing is in CNY, and the dollar figures shown use ¥7.2 = $1. By the end you should be able to estimate a Claude Code session, pick the model that fits the job, and connect the whole thing with two environment variables.
What 59API charges per million tokens
Here is the part that makes the arithmetic predictable. On 59API a Claude request is charged for three things: input tokens, output tokens, and cache reads. These are the current rates, per 1 million tokens.
- 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)
Notice the shape of these numbers. Output tokens cost several times more than input tokens on every model listed here, so the chatty part of your session is the expensive part, not the file you pasted in. Cache reads are the least expensive line by a wide margin, which is why repeated context in a long Claude Code conversation is worth understanding rather than ignoring.
For a reference point, the official list price for Sonnet 5.5 is $2 / $10, for Opus 5.5 it is $4 / $20, and for Haiku 4.5 it is $1 / $5. That list price is only a reference figure: 59API is an independent third-party relay, not an official channel of any model provider.
Three worked examples, token by token
Abstract rates only get you so far, so let us run three hypothetical workloads through them. Each example uses input and output tokens without cache, and compares the 59API total against the official list price as a reference.
- Claude Sonnet 5.5, 3M input + 0.5M output tokens without cache: $6.11 (¥44) on 59API; at official list price $11 (about ¥79.2), so 59API is about 56% of list price
- Claude Opus 5.5, 2M input + 0.5M output tokens without cache: $6.67 (¥48) on 59API; at official list price $18 (about ¥129.6), so 59API is about 37% of list price
- Claude Haiku 4.5, 5M input + 1M output tokens without cache: $3.4 (¥24.5) on 59API; at official list price $10 (about ¥72), so 59API is about 34% of list price
Read those three lines together and the pattern is clear. Haiku 4.5 handled the largest input volume of the three and still came in at about 34% of list price. Sonnet 5.5 with the heaviest output volume landed at about 56% of list price, and Opus 5.5, priced for the hardest reasoning work, at about 37% of list price. That is the practical argument for pay-as-you-go on 59API: you choose the model per task, and the bill follows the tokens you really used instead of a flat guess made in advance.
Nothing here is a promise about your own usage, because token counts depend on your prompts and your repository. But with these rates in hand, you can build a monthly estimate for Claude Code before you start a heavy session, and you can switch models mid-project when the cost profile changes.
Connecting Claude Code in two variables
Once the numbers make sense, the setup is short. 59API gives you one account and one API key, and every call goes through the single host https://api.59api.com. For Claude Code or Claude Desktop, set two environment variables:
ANTHROPIC_BASE_URL=https://api.59api.comANTHROPIC_AUTH_TOKEN=YOUR_59API_KEY
There is one boundary worth being clear about. Claude models work only through the genuine Claude Code or Claude Desktop client, and Claude Desktop needs Claude Code 2.1.285 or newer. They do not work through the OpenAI SDK, cURL, or any other OpenAI-compatible client; those routes are for GPT, DeepSeek and other non-Claude, non-Gemini models. If you try to force a Claude model through the wrong client, you are debugging a protocol mismatch, not a pricing problem.
Once the variables are in place, Claude Code talks to 59API the same way it talks to any endpoint: requests are metered by real token usage and charged to your prepaid balance. There is no monthly fee to remember and no quota to configure before your first prompt, so the cost of trying a model on a small task is simply the cost of that task.
Top-ups and optional cards
Pay-as-you-go on 59API starts with a prepaid balance, and the top-up amounts are deliberately small: ¥10, ¥50, ¥100, ¥200, ¥500, or ¥1000, paid by WeChat Pay or bank card, with invoices available. Because there is no monthly fee and the balance never expires, a small top-up is enough to start, and the money is still there next month if you do not use it.
Cards are the optional second path. 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. Quota and caps are card metering units written in $, not official list-price dollars, so they should not be read as official prices.
For example, C-PRO Entry (Claude, 30 days) costs $83.19 (¥599), with quota $610 and a weekly cap of $230, draining at the card's metering price × 2.4; its reference value at official list prices is about $169.44 (¥1220). The C-PRO $290 weekly card (Claude, 7 days) costs $40.14 (¥289), with quota $290 and a weekly cap of $290, draining at the card's metering price × 2.4, and a reference value at official list prices of about $80.56 (¥580).
Which one fits? If your usage is uneven, the prepaid balance simply follows your real token usage and keeps whatever you have not spent. If you want a predictable allowance for a heavy stretch, a card gives you one, with its own key and its own rules. Start with 59API on pay-as-you-go, read your first bill against the rates above, and let the numbers tell you which model and which plan to keep.
शुरू करने के लिए तैयार?
Claude, GPT और अन्य मॉडलों के लिए एक ही key, असली token उपयोग पर बिलिंग और कोई मासिक शुल्क नहीं। साइन अप करके अपनी API key बनाएं; हर मॉडल की दरें मूल्य पेज पर हैं।
मुफ़्त साइन अप मूल्य