59API

← Volver a las guías

One 59API key for Claude, GPT, Gemini, DeepSeek: API relay

Modelos · EN · 2026-11-18

One account, one key, and the API sprawl it removes

Here is the problem almost every developer hits sooner or later: you start with one model, add a second when it handles a task better, and a month later you are juggling separate accounts, separate API keys, separate dashboards and separate billing pages for Claude, GPT, Gemini and DeepSeek. Every new provider means another secret to store, another invoice format to decode, and another place where an unnoticed usage spike can quietly drain a budget.

59API is an independent third-party API relay built to remove that friction. One account gives you one API key and one API host, https://api.59api.com, and that key works across Claude, GPT, Gemini, DeepSeek and other models. It is not an official channel for any of those providers, and it does not pretend to be one. It is a straightforward relay layer sitting between your code and the models you want to call.

The billing model is refreshingly plain. You top up a prepaid balance, and 59API charges per request based on real token usage. There is no monthly fee, and your balance never expires, so an unused top-up is not a deadline you have to race. Top-ups come in ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, and invoices are available if you need one.

The rest of this guide walks through the actual setup, protocol by protocol, because the one thing you cannot skip is knowing which client speaks which model. Claude models work only in the genuine Claude Code or Claude Desktop client. Gemini models work only in Gemini CLI, over Google's native protocol. Everything else uses the OpenAI-compatible path. That is where the one-key promise pays off, and where a five-minute setup saves an afternoon of debugging.

Claude: two environment variables in the genuine client

Claude models on 59API work only through the genuine Claude Code or Claude Desktop client. That is a hard boundary, not a suggestion, and it exists because Claude models speak Anthropic's own protocol rather than an OpenAI-compatible one. If you try to send a Claude request through the OpenAI SDK, cURL or a third-party editor, it will not work.

Start with Claude Code 2.1.285 or newer, or a current Claude Desktop release. Then set two environment variables and restart the client so it picks them up:

That is the entire Claude setup. There is no second host, no per-provider key, and no separate account for Anthropic. The key you generated once in your 59API dashboard is the key your Claude client authenticates with, and the requests are billed against your prepaid 59API balance according to real token usage.

It is worth pausing on why this restriction matters in practice. Many developers assume every modern model is reachable through a generic chat-completions call. That assumption breaks quickly when a client expects a specific message shape, streaming convention or tool-calling format. By keeping Claude inside the official client, 59API avoids asking you to translate protocols by hand or maintain a pile of compatibility shims. You get Claude where Claude belongs, and you keep the same key management story across your whole stack.

Once the variables are in place, run a small prompt in Claude Code and confirm the response comes back before wiring it into a larger workflow. That quick check catches a stale environment variable or a mistyped key before it becomes a confusing failure inside a build script.

GPT, DeepSeek and other models: the OpenAI-compatible path

For everything that is not Claude and not Gemini, 59API uses the OpenAI-compatible route. This covers GPT, DeepSeek, Kimi K3, Qwen3.8 Max, MiniMax M3, GLM-5.3, Grok 4.7, Hunyuan 4, MiMo V2.6 Pro and other non-Claude, non-Gemini models. It also covers the clients developers already use: Codex, OpenAI SDKs, cURL, and OpenAI-compatible tools such as Cursor, Cherry Studio, Cline and OpenCode.

Two settings matter here. Point your client at the base URL https://api.59api.com/v1, and use the chat endpoint https://api.59api.com/v1/chat/completions. The same 59API key you use for Claude works for these models too, which is where the single-key workflow really starts to pay for itself.

For example, DeepSeek V4 Flash uses the model id deepseek-v4-flash, and its rates on 59API are $0.2778 (¥2) per 1 million input tokens, $1.11 (¥8) per 1 million output tokens, and $0.006944 (¥0.05) per 1 million cache-read tokens. GPT-6.1 Sol uses the model id gpt-6.1-sol, priced at $0.1847 (¥1.33) input, $0.9264 (¥6.67) output, and $0.0375 (¥0.27) cache read per 1 million tokens.

Because these clients already speak the OpenAI format, integration is mostly a matter of changing the base URL and swapping in your key. In an OpenAI SDK, that typically means overriding the base URL option and passing the 59API key as the API key. In cURL, it means a POST to the chat endpoint with the model name and your key in the request.

One practical habit: keep a tiny note of which model ids you have validated against the relay. Model names in 59API are stable identifiers such as gpt-6.1-sol or deepseek-v4-pro, and using the exact id is what prevents a confusing mismatch between what you expect and what the relay returns.

Gemini models work only in Gemini CLI

Gemini models are not OpenAI-compatible. They work only in Gemini CLI, and they use Google's native protocol. That means two things you should know before you wire anything up: Gemini requests do not go to https://api.59api.com/v1/chat/completions, and Gemini models do not run in Codex, the OpenAI SDKs, cURL, Cursor, Cherry Studio, Cline, OpenCode or any other OpenAI-compatible client. If a client speaks only the OpenAI chat-completions format, it is the wrong client for Gemini.

The supported setup is straightforward. Open Gemini CLI and set these two environment variables:

Restart the CLI afterwards so it picks up the new values. Your Gemini calls are then authenticated with the same 59API key used everywhere else in your setup, and the usage is charged to the same prepaid balance. The model ids available include gemini-2.5-flash, gemini-3.1-pro, gemini-3.8-flash and gemini-4-argon.

Rates are per 1 million tokens. Gemini 2.5 Flash is listed at $0.2083 (¥1.5) input, $1.67 (¥12) output, and $0.0208 (¥0.15) cache read. Gemini 3.1 Pro is listed at $1.39 (¥10) input, $8.06 (¥58) output, and $0.1389 (¥1) cache read.

Think of it this way: 59API gives you one identity across three protocol families. Claude goes through Claude Code or Claude Desktop, Gemini goes through Gemini CLI and nothing else, and everything else goes through the OpenAI-compatible base URL and chat endpoint. Three configuration shapes, one key, one balance, one bill to watch. That is a much smaller operational surface than four provider dashboards and four secrets, and it scales as you add more models later.

What it costs, and when a card makes sense

All 59API rates are quoted per 1 million tokens, billed in CNY, with USD figures shown at ¥7.2 = $1. Since billing follows real token usage, a worked example is the clearest way to estimate a bill. Take GPT-6.1 Sol with 5M input tokens and 1M output tokens, no cache: that is $1.85 (¥13.32) on 59API. At the official list price of $20 (about ¥144), 59API comes to about 9% of list price.

Compare Claude Sonnet 5.5 with 3M input and 0.5M output tokens, no cache: $6.11 (¥44) on 59API against an official list price of $11 (about ¥79.2), or about 56% of list price. Sonnet 5.5 itself is priced at $1.11 (¥8) input and $5.56 (¥40) output per 1 million tokens. These are reference comparisons, not claims about any provider's relationship to 59API.

Cards are optional. If your usage is steady enough to want a fixed allowance, a card carries its own key and can call only that family's models. For example, the C-PRO Entry card for Claude covers 30 days at $83.19 (¥599), with quota $610 and a weekly cap of $230, while the G-PRO Entry card for GPT also runs 30 days at $83.19 (¥599), with quota $2300 and a weekly cap of $880. Card quota drains at the card's metering price × 2.4, and the reference value at official list prices is about $169.44 (¥1220) and $638.89 (¥4600) respectively.

Two rules keep cards predictable. A card is paid only from the card and 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 treat them as card allowances rather than cash-equivalent credits.

Start with prepaid balance while you are wiring things up, then decide whether a card fits your pattern. Either way, 59API keeps the same promise: one key, one host, one balance, and a clear per-token bill.

Docs

¿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