Back to Home
Token Counting Across Languages: Why the Same Prompt Costs More in Chinese
Cost optimization8 min readSource: Admesh Engineering

Token Counting Across Languages: Why the Same Prompt Costs More in Chinese

Why character counts mislead, how to measure tokens per language, and how to budget multilingual prompts and outputs without blowing your LLM bill.

Why character counts are a bad proxy

A tokenizer splits text into subword units learned from a training corpus. Frequent sequences, like common English words or punctuation patterns, collapse into single tokens. Rarer sequences, including many CJK characters and Arabic word forms, get broken into multiple byte-level pieces. That means two strings with the same number of characters can produce very different token counts, and the direction of the error is not stable across languages or domains.

The practical failure mode is a budget built on len(text) or a word count. A team sizes a prompt at a few hundred characters, assumes a few hundred tokens, and then discovers the real count is higher for a Chinese locale. The reverse also happens: a Japanese string that looks long in characters may tokenize more efficiently than expected because of how the vocabulary was trained. Either way, the estimate is wrong in a way that only shows up on the invoice.

A second failure mode is cross-model drift. Tokenizers are model-specific, so a count produced by one provider's tokenizer is not a valid estimate for another provider's model. If your gateway routes the same prompt to different model families, you need counts per family, not one global number.

  • Do not use character counts, word counts, or byte length as a token estimate in production.
  • Do not assume the ratio between characters and tokens is constant across languages.
  • Do not reuse a token count from one model family when calling another.

Measuring tokens per language

Build a small measurement harness before you build a budget. The goal is a table of tokens per request, broken down by language, prompt template, and model family. You do not need a large corpus; a few dozen representative samples per language, drawn from real user traffic or realistic fixtures, will expose the ratios you need.

Use the provider's own tokenizer or token-counting endpoint rather than a third-party approximation. Both OpenAI and Anthropic document token-counting approaches in their production guidance, and the safest path is to call the counting utility that matches the model you will actually invoke. If you route through an aggregator, count against each target model family separately, because the same text can tokenize differently across them.

Record input and output tokens separately. Output is where multilingual products often surprise teams: a model generating Chinese or Arabic may emit more tokens than expected for the same answer length in English, and output tokens are typically the more expensive side of the bill. Store the counts alongside the request metadata so you can slice by language later.

  1. Collect 20 to 50 representative samples per supported language from real traffic or realistic fixtures.
  2. For each sample, call the token-counting utility for every model family you route to and record input tokens.
  3. Generate a fixed set of reference answers per language and record output tokens for the same model.
  4. Compute tokens per sample and per character for each language, and store the ratios with the model family name.
  5. Re-run the harness whenever you add a language, a model family, or a major prompt template change.
  6. Feed the ratios into your pricing and quota calculations instead of character-based estimates.

Budgeting multilingual prompts and outputs

Once you have per-language ratios, budgeting becomes a matter of applying them consistently. Set per-language token ceilings for prompts and completions rather than one global limit. A prompt that fits comfortably in English may exceed a ceiling in another script, and a completion limit tuned for English may truncate answers in a language that tokenizes less efficiently.

Be explicit about what happens when a request exceeds the ceiling. The common failure modes are silent truncation, which produces incomplete answers, and hard rejection, which produces a bad user experience. A middle path is to shorten or restructure the prompt, for example by trimming retrieved context or moving instructions into a more compact form, and to log every truncation with its language tag so you can see which locales are consistently over budget.

Also budget for the system prompt and any retrieved context, not just the user message. In RAG pipelines, retrieved chunks in the user's language can dominate the token count, and a multilingual index may return chunks in a language different from the query. Measure the full assembled prompt, not the individual pieces.

When to translate before or after the model call

Translation is a cost lever, but it is not free. Translating a prompt into English before the call can reduce token counts if English tokenizes more efficiently for your model, but it adds a translation call, introduces latency, and risks losing nuance in instructions, names, and formatting. For short prompts the translation overhead can exceed the savings.

Translating after the call has a different profile. Generating in English and translating the output can be cheaper if output tokens dominate and English output is more compact, but it doubles the number of model calls and can degrade tone, formality, and domain terminology. For customer-facing text, the quality loss is usually the deciding factor.

The pragmatic approach is to measure both paths on your own samples. Compare total tokens and total cost for the direct path versus the translate-then-call path, per language, and include the translation model's tokens in the comparison. Keep the direct path as the default and reserve translation for cases where the measured savings clearly justify the added complexity.

  • Direct call: lowest latency and complexity, highest token count for some languages.
  • Translate in: may reduce prompt tokens, adds a call and risks instruction drift.
  • Translate out: may reduce output tokens, adds a call and risks tone and terminology loss.
  • Hybrid: translate only long prompts or only specific content types, based on measured ratios.

How to apply this with Admesh

Admesh gives you one OpenAI-compatible base URL at https://api.admesh.ai/v1 and an Anthropic-compatible endpoint at https://api.admesh.ai/v1/messages, with a single API key and one balance across multiple model families including OpenAI, Anthropic, Google, DeepSeek, Qwen, Moonshot, Zhipu, and MiniMax. That makes it practical to run the same multilingual prompt against several families and compare token counts and costs without managing separate accounts.

Start by checking the live model catalog at https://admesh.ai/models and the pricing page at https://admesh.ai/pricing, since token counts and rates vary by model and change over time. Do not hardcode assumptions; read the current catalog values into your measurement harness.

Then run your per-language harness against each family you plan to route to, using the Admesh endpoints. Because one key covers all families, you can log tokens per language per model in a single place and pick the family that gives the best cost-quality tradeoff for each locale.

Finally, wire the resulting ratios into your routing and quota logic, and monitor spend in the console at https://console.admesh.ai. The docs at https://docs.admesh.ai cover the endpoint details you need for the integration.

FAQ

Admesh API docs →

FAQ

Can I estimate tokens by dividing character count by a fixed number?
No. The characters-to-tokens ratio varies by language, script, and model family, and it is not stable enough for budgeting. Measure with the provider's tokenizer on representative samples instead.
Does the same prompt cost the same across model families?
Not necessarily. Tokenizers differ between families, so the same text can produce different token counts. Count separately for each family you route to, and check current pricing in the live catalog rather than assuming parity.
Is translating to English always cheaper?
No. Translation adds a model call and can lose nuance, and the savings depend on how your target model tokenizes each language. Measure both paths on your own samples before switching.
How often should I re-measure?
Re-run the harness whenever you add a language, change a prompt template, or switch model families. Token counts and prices change, so treat the ratios as data to refresh, not constants.

References

Call these models through one gateway

Admesh provides a unified OpenAI-compatible API: one Base URL and one key for Claude, GPT, DeepSeek and more. New accounts get trial credit that never expires.