Gemini CLI on 59API: pay-as-you-go API relay setup
The monthly fee problem is a numbers problem
Most developers do not have a usage problem. They have a predictability problem. A subscription asks you to commit before you know how much you will send, how many tokens you will read back, or whether next month will be quiet or intense. Consider a hypothetical side project: you prototype with an assistant for a week, then leave it alone for two months. You still held a recurring charge for a service you barely touched. If you later want a heavier model for one difficult week, the same plan may not fit the workload.
59API takes the opposite approach. It is an independent third-party API relay, not an official channel, and it works on one simple rule: prepaid balance, charged per request by real token usage. There is no monthly fee, and your balance never expires. You are not paying for a seat, a tier or a calendar month. You are paying for the tokens your requests actually consume.
One account gives you one API key and one API host, https://api.59api.com, across Claude, GPT, Gemini, DeepSeek and other models. Monthly and weekly cards exist, but they are optional. That distinction matters: the default mode of 59API is a wallet you top up and spend from as you go, not a plan you renew. If your usage is uneven, spiky or still unknown, that is the mode that fits.
How prepaid balance actually works
Top-ups are deliberately small and granular. You can add ¥10, ¥50, ¥100, ¥200, ¥500 or ¥1000, paid by WeChat Pay or bank card, and invoices are available. Start with the smallest amount that fits your test, then top up again when the shape of your usage becomes clear. Nothing here is a recurring charge, and nothing expires while it sits in your balance.
Billing is in CNY, with USD figures shown at ¥7.2 = $1, and every published rate is per 1 million tokens. That framing keeps the arithmetic honest. Input tokens, output tokens and cache reads are metered separately, so a request that reads a large context but returns a short answer is priced differently from a request that generates a long response. You can see the difference in the rate tables before you write any code.
The other number worth holding onto is the one that does not move: the monthly fee is zero. Your spend tracks usage, and your balance carries over indefinitely. For a developer running experiments, an internal tool, or a product whose traffic is still changing shape, 59API turns an operating expense into a variable cost you can measure per request.
Gemini CLI rates you can check before you call
If you plan to drive Gemini models through Gemini CLI, the price table is where the pay-as-you-go case becomes concrete. Gemini 2.5 Flash (model id gemini-2.5-flash) lists input at $0.2083 (¥1.5), output at $1.67 (¥12) and cache read at $0.0208 (¥0.15) per 1 million tokens. Gemini 3.1 Pro (gemini-3.1-pro) lists input at $1.39 (¥10), output at $8.06 (¥58) and cache read at $0.1389 (¥1). Gemini 4 Argon (gemini-4-argon) lists input at $1.39 (¥10), output at $6.67 (¥48) and cache read at $0.0694 (¥0.5).
One protocol note before you wire anything up: Gemini models on 59API use Google's native protocol only, through Gemini CLI. They are not OpenAI-compatible and do not work on /v1/chat/completions. That is not a limitation to work around; it is the correct route for these models, and it keeps your setup honest about which client speaks which dialect.
The practical benefit of per-token pricing here is control. You decide which model handles which task, you can watch the balance move request by request, and a quiet week costs exactly what you used. No renewal decision, no unused-tier guilt.
Worked examples: what a real month of usage looks like
Here are two worked examples from the current rate tables. First, GPT-6.1 Sol with 5M input plus 1M output tokens, no cache: $1.85 (¥13.32) on 59API. At the official list price of $20 (about ¥144), 59API is about 9% of list price. Second, Claude Sonnet 5.5 with 3M input plus 0.5M output tokens, no cache: $6.11 (¥44) on 59API. At the official list price of $11 (about ¥79.2), 59API is about 56% of list price.
Read those figures as reference comparisons, not as a promise about every workload. Official list price is only a reference price; 59API is an independent third-party relay, not an official, partner or authorised channel of any model provider. What the examples show is the mechanism: a defined token volume maps to a defined charge, and the charge comes out of the balance you funded.
For a hypothetical developer running a batch job on weekdays and nothing on weekends, pay-as-you-go means the weekend costs nothing. If a client sends a heavier mix of requests one month, you top up and keep working. The model choice stays yours, and the bill follows the traffic.
When an optional card makes more sense
Cards exist for people who want a committed envelope rather than an open wallet, and they are genuinely different from balance. Each 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 are not converted into official prices.
Look at the C-PRO Starter (Claude, 30 days): $83.19 (¥599), quota $610, weekly cap $230, draining at the card's metering price × 2.4, with a reference value at official list prices of about $169.44 (¥1220). For GPT, the weekly G-PRO $1100 card costs $40.56 (¥292) for 7 days, quota $1100, weekly cap $1100, reference value about $305.56 (¥2200).
So the decision is numeric. If you can forecast a stable monthly volume for one model family and want a fixed 30-day ceiling, a card gives you that structure. If your usage is irregular, or you want to mix families from one key, the balance is the more flexible instrument. Claude cards serve Claude models, which on 59API work only in the genuine Claude Code or Claude Desktop client (Claude Code 2.1.285 or newer).
Connecting Gemini CLI to your balance
Setup is deliberately thin. For Gemini CLI, set GOOGLE_GEMINI_BASE_URL=https://api.59api.com and GEMINI_API_KEY=YOUR_59API_KEY. That is the native Gemini path, and Gemini models use it exclusively. For GPT, DeepSeek and other non-Claude, non-Gemini models, 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 chat endpoint https://api.59api.com/v1/chat/completions.
Claude is different by design: Claude models work only through the genuine Claude Code or Claude Desktop client (Claude Code 2.1.285 or newer), never through the OpenAI SDK, cURL or other clients. If you need Claude, set ANTHROPIC_BASE_URL=https://api.59api.com and ANTHROPIC_AUTH_TOKEN=YOUR_59API_KEY in the genuine client.
That is the whole model of working on 59API. One account, one key, one host, prepaid balance that never expires, per-request billing by real token usage, no monthly fee, and cards only if you want them. Top up with the amount that suits today, point Gemini CLI or your preferred client at https://api.59api.com, and let the numbers tell you what the next month should look like.
¿Listo para empezar?
Una sola clave para Claude, GPT y más, con facturación por tokens reales y sin cuota mensual. Regístrate para crear tu clave API; las tarifas de cada modelo están en la página de precios.
Registro gratis Precios