59API FAQ: Gemini CLI API relay setup for your first day
What is 59API, and what does the first day cost?
The hardest part of day one with AI APIs is rarely the model itself. It is juggling separate accounts, separate keys and separate billing pages before you can run a single useful prompt. 59API removes that friction. It is an independent third-party AI API relay: one account and one API key, one API host at https://api.59api.com, covering Claude, GPT, Gemini, DeepSeek and other models.
Billing is prepaid and based on real usage. You fund a balance, and every request is charged according to the tokens it actually consumes. There is no monthly fee, and your balance never expires, so an unused balance is not a ticking deadline. Monthly and weekly cards exist, but they are optional, and plenty of developers start with the wallet alone.
Top-ups come in ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card. Invoices are available when you need one. Prices are listed per 1 million tokens and billed in CNY, with USD figures shown at ¥7.2 = $1, so you can read every rate in whichever currency you prefer.
That structure removes two questions people usually argue about on a first day: what will I owe later, and what happens to what I already paid for? With 59API, you top up, you send requests, and the balance reflects exactly what you used.
How do I connect Gemini CLI to 59API?
Gemini CLI is the shortest path to a working session, because it already speaks Google's native protocol. Two environment variables are all it takes:
GOOGLE_GEMINI_BASE_URL=https://api.59api.comGEMINI_API_KEY=YOUR_59API_KEY
Point the base URL at 59API, drop your key into the token variable, and Gemini CLI sends its traffic through the same host and the same balance as everything else on your account. There is no second provider to register with and no second invoice to reconcile.
One boundary is worth repeating because it saves an afternoon of debugging: Gemini models use Google's native protocol only. They are not OpenAI-compatible, and they do not work on the /v1/chat/completions endpoint. If you are wiring Gemini CLI, keep the base URL exactly as shown above, without a /v1 suffix.
You can then start a session and watch the balance move as real tokens are consumed. Since 59API charges per request by real token usage, a short exploratory prompt costs a small fraction of the amount you prepaid, and there is no monthly fee waiting behind it.
For developers who want a fast sanity check before committing to a longer task, this is about as low-friction as a first day gets: one key, one environment file, one command.
Can Codex, cURL and the OpenAI SDK share the same key?
Yes. Codex, OpenAI SDKs, cURL and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode all point at the same 59API host and the same prepaid balance. The settings are:
- base_url
https://api.59api.com/v1 - chat endpoint
https://api.59api.com/v1/chat/completions
These clients work with GPT, DeepSeek and other non-Claude, non-Gemini models only. That restriction is about protocol compatibility, not about model quality or availability: Claude models require Anthropic's own client, and Gemini models require Google's native protocol.
The practical result is that you can keep one account and one key while moving between a terminal workflow and a desktop client. A Codex session and a Cherry Studio chat can run at the same time, and both draw from the same balance.
Because the balance is prepaid and charged by real token usage, running two tools in parallel does not create a surprise invoice. It simply consumes the balance faster, and you can see exactly how fast in the usage view.
If you are porting an existing project, the migration is mostly a settings change: swap the base URL, swap the key, and keep the rest of your request code intact.
How do I use Claude models on 59API?
Claude models work only through the genuine Claude Code or Claude Desktop client, using Claude Code 2.1.285 or newer. The configuration is as short as it gets:
ANTHROPIC_BASE_URL=https://api.59api.comANTHROPIC_AUTH_TOKEN=YOUR_59API_KEY
Claude models never work through the OpenAI SDK, cURL or other clients, and 59API does not attempt to translate between protocols. That honesty is useful on a first day: if a request fails, the cause is usually a wrong client or a wrong base URL, not a mysterious middle layer.
59API is an independent third-party relay, not an official channel of Anthropic, OpenAI or Google. Prices are 59API's own, and official list price appears in our documentation only as a reference point for comparison.
Once the two variables are set, Claude Code and Claude Desktop behave as you expect, drawing on the same prepaid balance as your other tools. There is no monthly fee, and the balance never expires, so you can leave a little in it for the next session.
A practical first-day habit: run one short prompt in each client you plan to use, confirm the balance updates, then move on to real work.
Which models should I try first, and what do they cost?
Prices are per 1 million tokens. Here are a few 59API rates worth keeping in view on day one, across input, output and cache read:
- Gemini 2.5 Flash: input $0.2083 (¥1.5), output $1.67 (¥12), cache read $0.0208 (¥0.15).
- Gemini 3.1 Pro: input $1.39 (¥10), output $8.06 (¥58), cache read $0.1389 (¥1).
- GPT-6.1 Sol: input $0.1847 (¥1.33), output $0.9264 (¥6.67), cache read $0.0375 (¥0.27).
- DeepSeek V4 Flash: input $0.2778 (¥2), output $1.11 (¥8), cache read $0.006944 (¥0.05).
- MiniMax M3: input $0.1389 (¥1), output $0.5556 (¥4), cache read $0.0278 (¥0.2).
Read across those rows and the shape of your first day becomes clearer. Flash and MiniMax-class models are cheap enough for quick experiments, while Pro-class models cost more per output token and are better reserved for tasks where quality justifies the spend.
Model ids are explicit, so you can paste them directly into a request: gemini-2.5-flash, gemini-3.1-pro, gpt-6.1-sol, deepseek-v4-flash and MiniMax-M3. Switching between them changes neither your account nor your key.
And because billing follows real token usage, a conversation that stays short stays cheap. You decide how much to preload; 59API simply meters what you actually send.
What will my first request cost, and should I add a card?
Consider a hypothetical first workload: GPT-6.1 Sol with 5M input tokens and 1M output tokens, no cache. On 59API that is $1.85 (¥13.32). At official list price of $20 (about ¥144), 59API is about 9% of list price.
A Claude comparison works the same way. Claude Sonnet 5.5 with 3M input and 0.5M output tokens, no cache, is $6.11 (¥44) on 59API, against an official list price of $16.5 (about ¥118.8) — about 37% of list price.
Those are the figures you would expect to see on a first bill: metered by token, deducted from a balance you control.
Cards are optional, and they behave differently from the wallet. A card has its own key, can call only 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 stated in official-price USD.
For example, 【周卡】G-PRO $1500 (GPT, 7 days) costs $40.56 (¥292) with quota $1500 and a weekly cap of $1500, draining at official price × 2.4, so about $625 of usage at official list prices. A first-day buyer usually starts with the prepaid balance instead, since it never expires and covers every model family.
¿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