LONG AI
Home › Blog › How API Tokens Add Up: A 5-Turn Billing

How API Tokens Add Up: A 5-Turn Billing Test, Measured

Category:问题解答 · 7 min read · 2026-10-20

TL;DR, so you don't have to scroll to the end: an API doesn't bill by "number of calls" — it bills by token. For the same model, output costs 4× more than input; and in a multi-turn conversation, every previous round gets resent and rebilled each time. Nail these two facts and your bill stops being a mystery.

What follows is real measured billing, not an estimate.

1. Read your bill from the source: the usage block

The API is standard OpenAI-compatible. A minimal call looks like this:

curl https://ai.dijinlong.com/v1/chat/completions \
  -H "Authorization: Bearer your-key" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4.1-flash",
       "messages":[{"role":"user","content":"Reply with exactly two words: got it"}],
       "max_tokens":20}'

This block in the response is what you're billed on:

"usage": {"prompt_tokens": 35, "completion_tokens": 16, "total_tokens": 51}

prompt_tokens is what you sent (input), completion_tokens is what the model returned (output). Multiply each by its own price and add them up — that's the cost of the call.

2. Is Chinese really pricier than English? Measured: barely

I ran three near-identical prompts in different forms, watching only prompt_tokens:

The conclusion is a bit counter-intuitive: each Chinese character is indeed "pricier," but there are fewer of them, so the whole sentence lands about even with English (52 vs 53). Hard-translating Chinese into English to save tokens is pure wasted effort — you just add a layer of translation drift.

What you should actually watch is long Chinese text: at 1.33 tokens/char, a 10,000-character document stuffed into the prompt is 13,000+ tokens in a single shot.

3. Five follow-up turns: input grew from 83 to 284 tokens

I set a 75-character system prompt (simulating a support bot), then asked 5 short questions in a row, resending the full history each turn — which is what nearly every chat client and agent does by default.

5-turn token log: input climbed from 83 to 284, 1,368 tokens total

4. Where the money goes: output is 60% of it

At deepseek-v4.1-flash's real price on the model plaza (¥0.20 in / ¥0.80 out per million tokens), those 5 turns cost:

Cost breakdown: input ¥0.000194 = 37.5%, output ¥0.000324 = 62.5%

The direct takeaway: if you want to save money, control the output first. Halving your question saves at most 18%; shrinking the answer from 200 to 50 words saves the big chunk.

Prices change; check the model plaza for the current rates.

5. Three things you can do right now

One more gotcha from testing: set this model's max_tokens to 8 and ask for a two-word reply, and completion_tokens still comes back 128 — all of it in reasoning_tokens. A reasoning model's "thinking" is billed as output, and a small max_tokens won't cap it. To cut spending, shorten the task or switch to a non-reasoning model; don't count on that parameter.

6. Common errors: raw response, cause, fix

These are actual responses captured from real calls, not copied from docs.

As an aside, the model plaza shows how many sellers and what discount each model has. In this screenshot, the DeepSeek family has 6 models with 6/6 official-price coverage:

Model plaza DeepSeek family, 6 models: deepseek-v4.1-flash lowest market price ¥0.2 / ¥0.8, 90% off

7. A formula you can compute yourself

Cost per call = total input tokens × input price + total output tokens × output price. Note that "total input" isn't "the words you typed" — it's everything sent out across every turn, summed.

To verify, log the usage from every response and look at the totals after a day. To wire your own program in, just change base_url — LONG AI's API is fully OpenAI-compatible.

相关文章

GPT-6.2 Cuts Prices 20%: What the AI Price War Means

GPT-6.2 cuts list prices 20%, yet platform discounts run deeper: gpt-6-astra trades at under 1% of list. What this week's AI price war means for buyer

What Is Prompt Caching? How Cache Tokens Cut API Bills

Prompt caching stores a repeated prompt prefix and bills cache reads at 5-12% of normal input. Real prices, hit conditions, and how to cut your API bi

All 12 Claude Models Compared: Price and Best Use

Twelve Claude versions are on sale. The newest opus-5-5 costs $8.91 a month; the oldest opus-4-6 costs $49.50. Full table and a pick for each workload

Which AI Model Writes Code Best? Speed and Price Tested

gpt-5.6-terra and deepseek-v4.1-flash win on price and reliability; gemini-3.8-flash is fastest. Effective prices, measured speed, and a three-tier pi

One API Key, Every Model: How to Integrate a Multi-Model Marketplace

Point your base URL at the platform and one key covers all 138 on-sale models across 51 vendors, in both OpenAI and Anthropic request formats. Copy-pa