59API

← Retour aux guides

Codex API proxy: a practical 59API setup for long sessions

Claude Code · EN · 2026-11-21

The real problem with running Codex all day

Running Codex all day turns API spending into an operating cost, not a side experiment. You pay for every planning pass, every file edit, every failed test and every retry, often across many hours. The problem is not that you need a model; it is that juggling separate providers, keys and billing dashboards gets old fast.

Here is the checklist for a developer in that situation: one place to authenticate, one host to configure, per-request billing you can inspect, and a balance you can top up without renegotiating a subscription each month. You also want enough freedom to switch models when a task calls for a different option.

59API is built around that shape of work. It is an independent third-party AI API relay, not an official service or an authorised channel for any model vendor. One account gives you one API key and one API host, covering Claude, GPT, Gemini, DeepSeek and other models. For a Codex user, the practical part is simpler: point Codex at one endpoint and keep working.

That matters on a heavy day. Imagine a twelve-hour session with a refactor in the morning and a test-fixing loop after lunch. Without consolidated billing, you are reconciling several bills against token counts you cannot easily verify. With 59API, every request is charged per request by real token usage against a prepaid balance, and the balance never expires.

What 59API changes about your billing routine

A prepaid balance changes how you think about the bill. There is no monthly fee, so an idle weekend costs nothing extra, and there is no expiry date hanging over money you have already added. Requests are charged per request by real token usage, so a long context costs more than a short prompt, and a cached repeat costs less again.

Top-ups are deliberately small steps: ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, with invoices available. A developer testing a new workflow can add ¥10, watch an afternoon of Codex traffic, and decide whether to scale up. A developer on a longer project can keep a larger balance in place without a recurring charge.

Cards are optional. If your usage is steady enough that topping up feels manual, monthly and weekly cards give you a fixed access period with a quota and caps. If your usage is spiky, the balance path stays simpler because you pay only for tokens you actually consume.

One account and one key also reduce operational overhead. Instead of rotating credentials or tracking which project used which provider, you configure one host. That is a small detail until you are deep into a session and need the next request to work without a detour through a dashboard.

The exact Codex connection

For Codex and other OpenAI-compatible clients, the setup is two values. Set base_url to https://api.59api.com/v1 and point the chat endpoint at https://api.59api.com/v1/chat/completions, then authenticate with your 59API key.

The same settings apply to the OpenAI SDKs, cURL, and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode. That makes it straightforward to keep Codex as the main driver while testing a different client for a side task.

There is an important boundary. Through Codex, the OpenAI SDKs, cURL and OpenAI-compatible clients, you can use GPT, DeepSeek and other non-Claude, non-Gemini models. Claude models work only through the genuine Claude Code or Claude Desktop client, version 2.1.285 or newer. Gemini models use Google's native protocol only, through Gemini CLI; they are not OpenAI-compatible and do not work on /v1/chat/completions.

For a Codex-only workflow, that boundary is easy to remember: GPT and DeepSeek families are in scope, and anything else needs its own client. The point is not to force one tool on every model, but to make the tool you already use work predictably.

Once configured, run a short real session. Inspect the token usage, compare the cost with what the same task would have cost elsewhere, and only then commit a full day of work to the setup.

Token rates you can plan an all-day session around

For a Codex user, the price that matters is the one attached to the model you keep in the loop. 59API lists rates per 1 million tokens, billed in CNY, with USD figures shown at ¥7.2 = $1.

GPT-6.1 Sol is $0.1847 (¥1.33) per 1M input tokens, $0.9264 (¥6.67) per 1M output tokens, and $0.0375 (¥0.27) for a cache read. GPT-5.6 Sol is $0.3472 (¥2.5) input, $1.94 (¥14) output, and $0.0278 (¥0.2) cache read. DeepSeek V4 Flash is $0.2778 (¥2) input, $1.11 (¥8) output, and $0.006944 (¥0.05) cache read.

Those numbers translate into a workable daily budget. In the worked example for GPT-6.1 Sol, 5M input plus 1M output tokens without cache costs $1.85 (¥13.32) on 59API, compared with the official list price of $20 (about ¥144), so 59API is about 9% of list price. For GPT-5.6 Sol, 2M input plus 0.5M output tokens without cache is $1.67 (¥12) on 59API, against an official list price of $18 (about ¥129.6), also about 9% of list price.

Read that as a planning tool rather than a promise. A heavy all-day session is a hypothesis you can price before it happens: you know the per-token rates, you know the reference list price, and you can estimate the bill before you start.

When a card suits your working rhythm

Cards suit a different rhythm. A monthly or weekly 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.

For GPT, the entry monthly card is G-PRO 入门版 at $83.19 (¥599), with quota $2300 and a weekly cap of $880. G-PRO 标准版 is $160.42 (¥1155), with quota $4500 and a weekly cap of $1700. For a short burst, 【周卡】G-PRO $1100 is $40.56 (¥292) for 7 days, with quota $1100 and a weekly cap of $1100.

Two details deserve attention. Quota and caps are card metering units written in $, not official list-price dollars, so do not convert them into official prices. And every card drains at the card's metering price × 2.4, which is a different mechanic from pay-as-you-go token billing.

So when does a card make sense? One hypothetical case: a developer knows a two-week sprint will generate predictable, heavy Codex traffic and wants a defined spend and a defined expiry. Another: a developer works in bursts and would rather pay strictly for tokens used, keeping a balance that never expires.

Both are defensible. The card suits commitment; the balance suits flexibility. 59API lets you choose per period instead of locking into one billing shape forever.

Who 59API suits, and who should look elsewhere

59API is a good fit if you run Codex all day and want a single key, a single host and per-request billing against a prepaid balance. It is especially useful if you move between GPT and DeepSeek models inside OpenAI-compatible clients, or want to add clients such as Cursor, Cherry Studio, Cline or OpenCode without changing providers.

It also fits developers who prefer small, reversible top-ups. Add ¥10, run a real task, look at the token bill, and top up again when the numbers justify it. There is no monthly fee and the balance never expires, so an experiment does not become a permanent commitment.

Now the honest limit. If your day depends on Claude or Gemini running inside Codex, 59API cannot do that: Claude models are reachable only from the genuine Claude Code or Claude Desktop client (2.1.285 or newer), and Gemini models only over Google's native protocol through Gemini CLI. Neither works in Codex, the OpenAI SDKs, cURL or any OpenAI-compatible client. If that is your setup, you need a separate client rather than a different 59API setting.

59API is also not an official channel for any model vendor. What it offers is an independent relay, transparent per-token rates, prepaid control and optional cards for heavier periods.

If that matches your working day, the next step is small. Top up a modest amount, configure the two Codex settings, and put one real task through the endpoint. Then judge it on your own token usage.

Docs

Prêt à commencer ?

Une seule clé pour Claude, GPT et d’autres modèles, facturée aux tokens réels, sans abonnement mensuel. Inscrivez-vous pour créer votre clé API ; les tarifs de chaque modèle sont sur la page Tarifs.

Inscription gratuite Tarifs