59API API relay: Gemini CLI and pay-per-token for uneven coding
The problem with a subscription for uneven coding work
Most developers do not use an AI coding assistant at a steady rate. A refactor might burn a morning of tokens, then the next three days involve a single question about a stack trace. A fixed monthly plan feels efficient in the busy week and wasteful in the quiet ones. It also asks you to estimate usage in advance, which is exactly the kind of forecasting that goes wrong when a model loops, a context window grows, or a teammate starts sharing a key.
Pay-per-token billing flips the problem. Instead of paying for capacity you might not use, you pay for the tokens your requests actually consume. On 59API, an independent third-party AI API relay, billing is based on real token usage, charged per request from a prepaid balance. There is no monthly fee, and the balance never expires. That makes the cost of an uneven workload visible: a heavy day draws more from the balance, a light day draws less, and nothing is lost while the project is quiet.
This is not a case for paying nothing during slow weeks. It is a case for paying for the work itself rather than for a calendar. If your usage spikes during release preparation, a subscription may look comfortable. If your usage arrives in bursts, or changes week to week, usage-based billing keeps the relationship between effort and spend direct. That is why 59API suits developers who want a simple rule rather than a fixed bill: use what you need, top up when you need it, and keep the remainder.
How 59API charges for what you actually send
59API gives you one account and one API key, and one API host at https://api.59api.com, covering Claude, GPT, Gemini, DeepSeek and other models. Rates are listed per 1 million tokens, billed in CNY, with USD shown at ¥7.2 = $1. That unit matters when you compare options: you can price a specific request pattern instead of guessing what a month might contain.
Some current rates show the range. Gemini 2.5 Flash is $0.2083 (¥1.5) for input and $1.67 (¥12) for output per 1 million tokens, with cache read at $0.0208 (¥0.15). DeepSeek V4 Flash is $0.2778 (¥2) input and $1.11 (¥8) output. MiniMax M3 is $0.1389 (¥1) input and $0.5556 (¥4) output. GPT-6.1 Sol is $0.1847 (¥1.33) input and $0.9264 (¥6.67) output. Low per-token rates are only half the story; cache reads matter when a long context is read again and again.
Top-ups start small and scale: ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, with invoices available. Because the balance never expires, a small top-up is a safe way to test a model on a real task, and a larger one removes the interruption of topping up mid-refactor. You are not committing to a tier, and you are not paying for an idle month.
What a burst of work actually costs
Because billing follows real token usage, the cost of an uneven week can be estimated from the workload itself. Take GPT-6.1 Sol with 5M input and 1M output tokens, without cache: on 59API that is $1.85 (¥13.32). At the official list price of $20 (about ¥144), the same request pattern is about 9% of list price. For GPT-5.6 Sol with 2M input and 0.5M output tokens without cache, 59API charges $1.67 (¥12), against $18 (about ¥129.6) at official list price, again about 9% of list price.
Claude models follow the same usage-based logic. Claude Sonnet 5.5 with 3M input and 0.5M output tokens without cache costs $6.11 (¥44) on 59API, compared with $11 (about ¥79.2) at official list price, so about 56% of list price. Claude Haiku 4.5 with 5M input and 1M output tokens without cache is $3.4 (¥24.5) on 59API, against $10 (about ¥72) at official list price, about 34% of list price.
These are worked examples, not quotes for a specific project, and official list price is only a reference price. Their value is the shape they reveal. A subscription asks you to decide a monthly budget before you know the workload. Pay-per-token lets you take one realistic task, look at its token count, and price it. If the task is small, the bill is small. If it is large, you still know exactly what drove the number.
When an optional card makes sense
59API also offers optional monthly and weekly cards for developers whose usage is heavy and concentrated enough to want a defined quota and cap. Cards are not required, and pay-per-token remains the default way to work. A card has its own key, can only call that family of 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.
For example, the G-PRO Starter card for GPT covers 30 days at $83.19 (¥599), with quota $2300 and a weekly cap $880. For a shorter burst, the weekly G-PRO $1100 card covers 7 days at $40.56 (¥292), with quota $1100 and a weekly cap $1100. On the Claude side, the weekly C-PRO $290 card covers 7 days at $40.14 (¥289), with quota $290 and a weekly cap $290. Card quota and caps are metering units written in $, not official list-price dollars, and card usage drains at the card metering price × 2.4.
So the decision is straightforward. If your workload is irregular and you would rather pay only for what you send, stay on the prepaid balance. If your usage is sustained, a card can add a quota boundary and a weekly cap. Either way, 59API gives you the same underlying per-token pricing view, and you can switch approach without changing the API host.
Connect it and start with one real task
The quickest way to judge 59API is to point it at work you already have. For Gemini CLI, set GOOGLE_GEMINI_BASE_URL=https://api.59api.com and GEMINI_API_KEY=YOUR_59API_KEY. Gemini models use the native Google protocol only, so they are not OpenAI-compatible and do not work on the /v1/chat/completions endpoint. For Claude Code or Claude Desktop, set ANTHROPIC_BASE_URL=https://api.59api.com and ANTHROPIC_AUTH_TOKEN=YOUR_59API_KEY; Claude models work only through the genuine Claude Code or Claude Desktop client, version 2.1.285 or newer.
For Codex, OpenAI SDKs, cURL and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode, use base_url https://api.59api.com/v1 and the chat endpoint https://api.59api.com/v1/chat/completions. Those clients pair with GPT, DeepSeek and other non-Claude, non-Gemini models only.
Then top up ¥10 or ¥50, run the task that has been waiting in your backlog, and compare the balance change with what a flat monthly fee would have cost you. That is the whole argument for pay-per-token on 59API: no monthly fee, no expiring balance, per-token billing based on real usage, and optional cards when a burst becomes a pattern. Uneven workloads deserve uneven bills.
Ready to get started?
One key for Claude, GPT and more, billed by real token usage with no monthly fee. Sign up to create your API key; rates for every model are on the pricing page.
Sign up free Pricing