59API

← Voltar aos guias

Input vs output tokens on 59API API relay for Claude Code

Modelos · EN · 2026-11-07

Why two token rates decide your API bill

Most developers choose a model by capability and then get surprised by the bill. The reason is straightforward: an API prices two different things separately — the tokens you send and the tokens it sends back. Input tokens are your prompt, the context you attach and the conversation history you replay. Output tokens are the model’s reply. When you read a price per 1 million tokens, you are looking at two rates, not one.

On 59API, those rates are visible before you commit to anything. You pay per request based on real token usage, drawn from a prepaid balance, with no monthly fee and no expiry on the balance you have already loaded. That means you can reason about cost directly: count the input, estimate the output, multiply by the two rates, and you have the shape of the request’s cost.

The practical consequence is that output-heavy work is usually the expensive half. A long system prompt, a large file and a long chat history all inflate input. A request for a detailed plan, a complete function implementation or a thorough explanation inflates output. Trimming context cuts input tokens; asking for a tighter answer cuts output tokens. Both levers are yours, and both show up directly in usage.

This is also why a flat monthly card can feel like a different product rather than a cheaper version of the same one. Cards are convenient, but pay-as-you-go keeps the relationship between what you build and what you pay intact. The rest of this article walks through actual rates and actual totals, so you can pick a model on cost instead of instinct.

Worked examples: what a request really costs

Here is a hypothetical request on GPT-6.1 Sol: 5M input tokens plus 1M output tokens, without cache. On 59API that costs $1.85 (¥13.32). At the official list price of $20 (about ¥144), the same workload would cost roughly ten times more — 59API comes to about 9% of list price. Notice how the output rate shapes the total: output is the smaller token count here, but it carries the higher per-million price.

Now take Claude Sonnet 5.5 with 3M input tokens plus 0.5M output tokens, without cache. On 59API the cost is $6.11 (¥44). At the official list price of $11 (about ¥79.2), 59API is about 56% of list price. The saving is smaller here, and the reason is structural rather than mysterious: a Claude request with three million input tokens is dominated by input, and input is billed at the input rate.

Two more examples make the pattern clearer. Claude Opus 5.5 with 2M input plus 0.5M output tokens without cache costs $6.67 (¥48) on 59API, against an official list price of $18 (about ¥129.6) — about 37% of list price. Claude Haiku 4.5 with 5M input plus 1M output tokens without cache costs $3.4 (¥24.5) on 59API, against $10 (about ¥72) — about 34% of list price. Same relay, same billing model, very different totals because the models and token mixes differ.

The takeaway for budgeting is simple. Multiply your input volume by the input rate, multiply your expected output by the output rate, and add the two. Cache reads, where applicable, are a third line and are usually the smallest.

Reading the rate sheet without guessing

Here are five rates from the 59API sheet, per 1 million tokens, with USD shown at ¥7.2 = $1. Read them as three columns: what you pay to send, what you pay to receive, and what you pay to reuse cached context.

Two habits make these numbers actionable. First, price the model you actually plan to use, not the model you admire. Second, look at the output column twice, because that is where long generations live. If your workload is mostly short classifications and summaries, a lower output rate matters more than a headline input rate. If your workload is long-form generation, output dominates and the ordering can flip.

Cache reads are worth noticing too. On 59API a cache read is a fraction of the input rate on every model listed above. If your application repeatedly sends the same large context, cached context can meaningfully reduce the input side of the bill. The billing is still per request and per real token usage, so the saving appears in the usage record rather than as a separate discount line.

Wiring it up: Claude Code on 59API

Once the economics make sense, the setup is short. 59API is an independent third-party AI API relay: one account and one API key, one API host at https://api.59api.com, for Claude, GPT, Gemini, DeepSeek and other models. For Claude Code or Claude Desktop, set ANTHROPIC_BASE_URL=https://api.59api.com and ANTHROPIC_AUTH_TOKEN=YOUR_59API_KEY.

One constraint matters more than any other here: Claude models work only through the genuine Claude Code or Claude Desktop client, version 2.1.285 or newer. They do not work through the OpenAI SDK, cURL or other clients. If you are wiring an SDK, cURL, Codex or an OpenAI-compatible client such as Cursor, Cherry Studio, Cline or OpenCode, use base_url https://api.59api.com/v1 and the chat endpoint https://api.59api.com/v1/chat/completions — and pair it with GPT, DeepSeek and other non-Claude, non-Gemini models. Gemini models use Google’s native protocol through Gemini CLI with GOOGLE_GEMINI_BASE_URL=https://api.59api.com and GEMINI_API_KEY=YOUR_59API_KEY; they are not OpenAI-compatible.

Because the same key serves every family, you can compare a Claude run against a GPT run without rebuilding your environment. That is exactly the situation where a clear rate sheet pays off: switch models, watch the input and output counts, and see the cost difference in usage rather than in a subscription tier.

Prepaid balance or card: which one fits

59API gives you two ways to pay, and the token math decides which is better for you. Pay-as-you-go uses a prepaid balance charged per request by real token usage. Top-ups come in ¥10, ¥50, ¥100, ¥200, ¥500 and ¥1000, paid by WeChat Pay or bank card, with invoices available. There is no monthly fee, and your balance never expires. If your usage is variable, or you are still learning how many tokens your prompts really consume, this is the straightforward option.

Cards are the other option, and they are optional. A 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. Card quota and caps are metering units written in dollars, not official list-price dollars, so they should not be read as official prices.

Take the C-MAX Standard Edition card for Claude, valid 30 days: $319.31 (¥2299), quota $2350, draining at the card’s metering price × 2.4, with a reference value at official list prices of about $652.78 (¥4700). Or the weekly G-PRO $1100 card for GPT, valid 7 days: $40.56 (¥292), quota $1100, weekly cap $1100, again draining at the card’s metering price × 2.4, with a reference value at official list prices of about $305.56 (¥2200).

So: predictable, high-volume usage on one model family can suit a card; mixed or uncertain usage suits the prepaid balance. Either way, the token rates above are the ground truth, and 59API lets you start small, measure your real input and output, and then decide.

Docs

Pronto para começar?

Uma só chave para Claude, GPT e outros, com cobrança por tokens reais e sem mensalidade. Cadastre-se para criar sua chave API; as tarifas de cada modelo estão na página de preços.

Cadastro grátis Preços