Codex API proxy with 59API: base URL, key, and model setup
1. Why Codex setup usually eats an afternoon
Codex is fast once it is configured. The slow part is everything around it: finding the right base URL, working out whether the API expects /v1 or /v1/chat/completions, pasting the right model id, and confirming that the key you are holding is actually the key the provider issued. A missing slash in the path produces a confusing 404. A wrong endpoint shape produces a 400 that looks like a model problem. And if you are comparing several model families, you can easily end up maintaining several accounts, several keys, and several separate billing systems.
59API removes that fragmentation. It is an independent third-party AI API relay with one account, one API key, and one API host: https://api.59api.com. That single key reaches Claude, GPT, Gemini, DeepSeek and other models, subject to the client rules explained below. Billing is prepaid and charged per request by real token usage, so you pay for what you actually send and receive. There is no monthly fee, and your balance never expires.
That combination is why setup becomes quick. You are not wiring together a new provider for every experiment. You configure one host once, and the remaining work is choosing a model id and topping up your balance. The checklist below covers the exact values to paste, the models that belong in Codex, what a typical run costs, and how to fund the account without a subscription.
- One account, one API key, one API host
- Prepaid balance charged by real token usage
- No monthly fee; balance never expires
2. The exact settings for Codex
Codex, OpenAI SDKs, cURL and OpenAI-compatible clients such as Cursor, Cherry Studio, Cline and OpenCode work with GPT, DeepSeek and other non-Claude, non-Gemini models only. With 59API, the settings are these:
- Base URL:
https://api.59api.com/v1 - Chat endpoint:
https://api.59api.com/v1/chat/completions - API key:
YOUR_59API_KEY
Copy the base URL exactly as written, including the trailing /v1. If your client asks for the endpoint separately, give it the full chat endpoint. Then paste your 59API key into the API key field and pick a supported model id in the next section. There is no second host to register and no separate key to request per model family, which removes the most common source of configuration errors.
One boundary is worth stating plainly, because getting it wrong wastes time. 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. Gemini models use Google's native protocol only and do not work on /v1/chat/completions. So inside Codex, your working set is GPT, DeepSeek, Qwen, Kimi, MiniMax and the other non-Claude, non-Gemini models served by 59API. If you need Claude or Gemini, they belong in their own clients, configured separately.
3. Model ids and rates you can paste directly
Once the base URL and key are in place, choose a model id from the list below and copy it exactly. All rates are per 1 million tokens, billing is in CNY, and the USD figures are shown at ¥7.2 = $1.
- GPT-6.1 Sol, model id
gpt-6.1-sol: input $0.1847 (¥1.33), output $0.9264 (¥6.67), cache read $0.0375 (¥0.27); official list price $2 / $10. - GPT-5.6 Sol, model id
gpt-5.6-sol: input $0.3472 (¥2.5), output $1.94 (¥14), cache read $0.0278 (¥0.2); official list price $4 / $20 (OpenAI promotional price, at least through 2026-11-21). - DeepSeek V4 Flash, model id
deepseek-v4-flash: input $0.2778 (¥2), output $1.11 (¥8), cache read $0.006944 (¥0.05). - Qwen3.7 Plus, model id
qwen3.7-plus: input $0.1389 (¥1), output $0.4167 (¥3), cache read $0.0417 (¥0.3).
Because every request is metered on real token usage, the numbers above are the whole pricing story for these models: no seat fee, no subscription, no minimum commitment. Start with the id that matches the task, run a short request, and check the balance movement before scaling up. If you later want to compare a larger GPT or DeepSeek tier, the same base URL and the same 59API key keep working, so switching models does not mean reconfiguring the client or opening another account.
4. What a real Codex run costs
Small numbers are easier to trust than slogans, so here are two worked examples with 59API, both without cache reads.
- GPT-6.1 Sol, 5M input plus 1M output tokens: $1.85 (¥13.32) on 59API. At the official list price of $20 (about ¥144), 59API is about 9% of list price.
- GPT-5.6 Sol, 2M input plus 0.5M output tokens: $1.67 (¥12) on 59API. At the official list price of $18 (about ¥129.6), 59API is about 9% of list price.
Consider a hypothetical week of heavier local development: repeated agentic edits, test runs, and long context windows sent back and forth. Because 59API meters each request by the tokens it actually consumes, that week maps directly onto the per-million-token rates above. There is no minimum spend to trigger and no idle monthly charge while you are not calling the API.
This is also where the prepaid model earns trust. You top up an amount you are comfortable with, and the balance stays there until you use it. If a project pauses, nothing evaporates and nothing renews. When you want to compare spend across models, the per-model rates and model ids in the previous section are enough to build a simple projection, and the same key handles the calls.
5. Fund the account, then make the first request
59API uses a prepaid balance. Top-up options are ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, and invoices are available. Start with the amount that matches your expected usage, send a test request through Codex, and confirm the deduction matches the token counts you sent. There is no monthly fee on the account itself.
Monthly and weekly cards are optional. If you prefer a prepaid card, the G-PRO Starter (GPT, 30 days) is $83.19 (¥599), with quota $2300, a weekly cap $880, draining at the card's metering price × 2.4, and a reference value at official list prices of about $638.89 (¥4600). Cards have their own key, can only call that family's models, and are paid only from the card: they never fall 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 treat them as limits rather than price comparisons.
That is the whole checklist: create the account, top up, copy https://api.59api.com/v1 as the base URL, paste YOUR_59API_KEY, choose a model id such as gpt-6.1-sol or deepseek-v4-flash, and send your first request. One host, one key, per-request billing, and no monthly fee to keep you subscribed.
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