Detecting Token Watering-Down in Third-Party API Relays: Four Verification Methods and an Acceptance Checklist
A third-party API relay (a proxy or aggregation service) sits between your application and the real model, which means it also controls the usage numbers you are billed for. This article explains what "token watering-down" means — inflated usage counts, silent model downgrades or impersonation, and truncated responses — and walks through four practical detection methods: dirty-token fingerprinting, knowledge-boundary probing, stability and usage reconciliation, and behavioral fingerprinting. It also covers a dedicated response-truncation check, a combined acceptance table with suggested thresholds, guidance for turning these checks into scheduled monitoring within compliance limits, and answers to common questions. The goal is to convert a vague feeling that "something is off" into measurements that are repeatable and auditable, useful for cost audits, API acceptance testing, downgrade investigations, and long-term monitoring.
1. What token watering-down means, and who should check for it
A relay (also called a forwarding service) usually refers to a third-party API proxy or aggregation service. It sits between the caller and the real model: it forwards requests, returns responses, and tallies the usage you are charged for. For developers and teams, using a relay is not just a matter of swapping a base URL — it also raises questions about cost auditing, API acceptance, downgrade investigation, and service quality monitoring.
“Token watering-down” is not a single fault. It is an umbrella term for possible discrepancies across three dimensions: billed usage, the real model tier, and response quality. Common forms include:
- Inflated usage: the
usageblock returned by the API is larger than the actual consumption, so you pay for numbers that were padded. - Downgrade or impersonation: the response is actually produced by a smaller-parameter model, an older version, or a cheaper model, while the API still claims to be the model you requested.
- Truncated responses: long output is silently compressed, cut off early, or missing its ending, yet billing is still settled as if the full output had been generated.
These problems are hard to spot because the API still responds normally and the content often looks plausible. Relying on subjective impression alone makes it very difficult to tell whether padding is actually happening. A more reliable approach is to turn the question “what did I buy versus what did I actually get” into something measurable, reproducible, and auditable.
This article covers four practical detection methods: dirty tokens, knowledge-boundary probing, stability and usage reconciliation, and behavioral fingerprints. It then adds a dedicated response-truncation check, an acceptance checklist, threshold suggestions, and compliance boundaries — material aimed at developers doing cost audits, API acceptance, downgrade triage, and routine monitoring.
2. Method 1: Dirty tokens — build a model fingerprint from distinctive tokenization behavior
The dirty-token method is relatively cheap and its conclusions are comparatively easy to re-verify. Its underlying assumption is that different models may use different, or at least distinguishable, tokenizers, and that this difference must be validated for the target model first.
Tokenization differences should not be treated as absolutes. Some models may share a vocabulary, some closed-source tokenizers cannot be reproduced locally, and some APIs do not expose token boundaries at all. For that reason, the dirty-token method should not be used in isolation; it is one input into a model-identity judgment.
A “dirty token” can be understood as a class of input units that appear rarely in a model’s distribution, behave abnormally, are easily mishandled, or trigger odd behavior. They may include low-frequency words, rare characters, unusual symbols, code fragments, and mixed-language snippets. Because models handle such inputs differently, these inputs can serve as a fingerprint.
How to construct dirty-token probes
Cover at least the following input categories:
| Probe type | Example direction | What to observe |
|---|---|---|
| Low-frequency words or rare characters | Obscure terminology, rare CJK characters, long-tail entities | Garbled output, refusals, repetition, or odd explanations |
| Special characters | Emoji, zero-width characters, unusual punctuation, control characters | Stable recognition, or changes in output structure |
| Code fragments | Regular expressions, nested JSON, unusual syntax, long symbol strings | Complete output, or incorrect completion |
| Mixed Chinese-English | Mixed terminology, code mixed with prose | Whether meaning is preserved, whether language switching behaves oddly |
| Numbers and version strings | Dates, version numbers, long integers, units | Confusion, or incorrect normalization |
To reduce the influence of chance, set up control models alongside. For example, if you know model A tends to fail on obscure code snippets while model B is more stable with special characters, send the same probe set to the relay and to the known models, then observe which behavior the target endpoint resembles.
Pass criteria and sample size
Do not draw conclusions from a single run. A more defensible procedure:
- Prepare 5–10 probes per category;
- Repeat each probe 3–5 times;
- Fix
temperature,top_p,system prompt, and other parameters as far as possible; - Record whether the output is normal, whether its length is abnormal, whether it was refused, and whether it was garbled;
- Compare the target endpoint separately against the claimed model and against the control models.
If the target endpoint matches the claimed model closely and differs clearly from the other controls, that provides initial support for “model identity is consistent.” If its failure pattern instead resembles another model more closely, further investigation is warranted for possible model substitution or downgrade.
In addition, if the target model has a public or obtainable tokenizer, you can compute the theoretical token count locally and compare it with the usage returned by the API. Be careful, though: if the closed-source tokenizer is unavailable, if vocabularies are shared, or if the accounting conventions differ, token counts alone are not enough — you need behavioral probes and usage reconciliation as well.
3. Method 2: Knowledge-boundary probing — verify the model generation matches
Every model has a knowledge cutoff in its training data. Different generations and different versions usually differ in how well they know events after that cutoff, and this difference can be used to detect whether the model identity has been swapped.
Knowledge-boundary probing focuses on three kinds of questions:
- Asking about events after the cutoff: if the API claims to serve an older version but answers questions about events that should not be in its training data fluently and confidently, the model may have been substituted — or the model may simply be hallucinating.
- Asking about well-established facts before the cutoff: if the model struggles with clear facts that predate its own cutoff, that also shows its capability boundary does not match its claimed identity.
- Asking about version-specific behavior: certain output formats, reasoning styles, refusal policies, or tool-calling conventions were introduced in particular versions and can serve as generation markers.
Note that a model’s self-report of “which version I am” is generally not usable as evidence, because a single system prompt can change how the model describes its identity. The genuinely useful evidence comes from capability boundaries, knowledge boundaries, and stable behavioral differences — not from self-declaration.
For practical acceptance testing, prepare a small set of knowledge-boundary questions, for example:
- An event that clearly happened after the cutoff;
- A stable fact that clearly predates the cutoff;
- An output format supported only by a specific version;
- A refusal or safety policy characteristic of a specific version.
If results after several runs deviate systematically from the claimed version, treat it as a warning sign.
4. Method 3: Stability and usage reconciliation — targeting billing padding directly
If dirty tokens and knowledge boundaries lean more toward detecting “was the model swapped,” then stability and usage reconciliation serve the more direct goal: “is billing padded?”
4.1 Local usage self-check
Usage self-checking is the approach closest to cost auditing. The basic idea is to compute the theoretical token count of input and output locally, then compare it with the usage returned by the API.
It can be written as:
Local token count of input text = ALocal token count of output text = Busage returned by the API = CExpected consumption ≈ A + B
If C is consistently and clearly larger than A + B, usage padding may be present. There is a crucial precondition, however: the measurement basis must be identical on both sides.
Recommended fixed conditions:
- Use the same tokenizer;
- Fix sampling parameters such as
temperature,top_p, andtop_k; - Record the complete
system prompt; - Establish whether hidden tokens or extra prompts exist;
- Establish the stop sequences, end tokens, and truncation rules;
- For streaming output, fully concatenate first and count afterwards;
- If retries occurred, distinguish per-request usage from total cumulative usage;
- Average over multiple samples to avoid misjudging from a single fluctuation.
Only when input, output, and tokenization bases are consistent does comparing C with A + B mean anything.
4.2 Streaming versus non-streaming comparison
Send the same prompt as both a streaming and a non-streaming request, and compare the returned text and the usage figures.
Under normal conditions, the fully concatenated streaming text should closely match the non-streaming output, and the usage fields should be essentially the same. Clear differences between the two suggest an anomaly worth investigating, with common causes including relay-layer concatenation, truncation, retries, caching, or inconsistent accounting conventions.
4.3 Consistency checks
Repeat an identical request several times and observe whether output and usage stay stable. It would be too simple to claim that a deterministic endpoint must return exactly the same thing every time. A more accurate statement is: with fixed parameters, the same instance is usually fairly stable, and any fluctuation should be attributed to load balancing, routing, or non-deterministic implementations before it is attributed to padding.
For example, temperature=0 does not guarantee full determinism in every implementation. If the system sits behind multiple instances, routing strategies, quantization differences, or non-deterministic operators, output can vary slightly. Only when fluctuation clearly exceeds a reasonable range, and when usage, content length, and stop_reason are simultaneously abnormal, is it more appropriate to suspect padding or unusual scheduling.
4.4 Latency and error patterns
Models of different sizes and different generations can differ in time to first token, token streaming speed, timeout behavior, and error-code distribution. Collecting these metrics continuously and comparing them with a known model profile helps indicate whether the backend model has been swapped.
For instance, if an API claims to serve a high-tier model but its time-to-first-token and streaming speed clearly match the profile of a much smaller model, combine this method with the others for further verification.
5. Method 4: Behavioral fingerprints — identify identity from output habits
Even when capabilities are close, models often differ stably in output style. These behavioral differences can be treated as a “behavioral fingerprint.” Its discriminative power is usually weaker than the dirty-token method, but its advantage is that it needs no specially constructed inputs and suits long-term, passive monitoring.
Suggested fields to collect as behavioral fingerprints:
- Formatting preference: default use of Markdown, lists, headings, tables;
- Refusal templates: fixed phrasing when declining;
- Punctuation habits: preference for full-width or half-width punctuation, semicolons, em dashes;
- Code block style: language tags by default, preference for comments;
- Sampling randomness: repetition versus divergence across repeated requests to the same prompt;
- Answer length distribution: tendency toward long, short, or fixed-structure answers;
- Safety policy differences: whether handling of certain sensitive topics is consistent.
Before using behavioral fingerprints, establish a baseline. The baseline can come from outputs of a model you trust, or from the target endpoint’s stable behavior across many normal requests. Once a style shift appears — for example, formatting habits suddenly change, refusal phrasing changes, or code block style becomes unusual — combine dirty tokens, knowledge boundaries, and usage reconciliation to localize the cause.
6. Response truncation: do not rely on usage alone, check whether output is complete
Response truncation is easily overlooked. It does not necessarily show up as anomalous usage; instead, usage may look normal while the output was simply cut short. Common scenarios include:
- Long-form text truncated halfway through;
- JSON output missing its closing braces;
- Code blocks missing their ending;
- A final paragraph silently dropped;
- Streaming output stopping mid-way with no explicit error;
- An abnormal
stop_reasonwhile billing still settles as full output.
Because of this, add a dedicated truncation check in addition to usage reconciliation.
Detection items
Check at least the following:
stop_reasonorfinish_reason: does it indicate normal completion, or termination due to a length limit, content policy, or an error?- Output length comparison: does the actual length match the claimed model, historical baselines, or task requirements?
- Beginning and end integrity: does the article have an ending, is the code closed, is the JSON parseable?
- Parseability of structured output: if JSON, tables, or function calls were requested, verify that they are valid.
- Long-text continuation test: ask the model to continue from the truncated point and observe whether it joins coherently.
- Streaming completeness: after concatenating streamed chunks, is the result complete, and is any tail content missing?
How to judge
If the API claims to return complete output but stop_reason indicates a length limit, or if the output clearly lacks an ending, suspect truncation. If the task requires full generation but the system enforces a small max_tokens silently, that alone can cause an acceptance failure.
For cost auditing, truncation is not only a quality problem but also a source of billing disputes: charging for full output when the content is incomplete is precisely the kind of anomaly that deserves close scrutiny.
7. Combining the methods: turn them into an acceptance table
Every single method has blind spots. The recommended approach is to combine the four methods with the dedicated truncation check into one acceptance table, which makes it practical to run as an engineering process.
| Method | What it judges | Inputs and samples | Expected evidence | Suggested threshold or decision rule | Action |
|---|---|---|---|---|---|
| Dirty tokens | Whether the backend model was swapped | Low-frequency words, special characters, code, mixed-language probes | Output pattern matches the claimed model and differs from controls | Anomaly rate clearly above baseline, or similarity to a control model is abnormal | Retest, switch endpoint, contact the provider |
| Knowledge-boundary probing | Whether the model generation matches | Events before and after the cutoff, version-specific behavior | Answer boundaries consistent with the claimed version | Persistent errors on key boundary questions | Re-verify model version, preserve evidence |
| Usage self-check | Whether billing is padded | Fixed prompt, local tokenizer counts | C essentially matches A + B |
Multi-run average deviates persistently by more than 5%–10% | Reconcile accounting basis, file a dispute, switch provider |
| Streaming vs non-streaming | Whether concatenation, truncation, or accounting is faulty | Same prompt sent both ways | Text and usage are consistent | Mismatch rate above 10% across runs needs investigation | Check the relay layer, retry, and caching strategy |
| Behavioral fingerprint | Whether long-term style has shifted | Samples from everyday calls | Format, refusals, and code style stay stable | Clear deviation from baseline | Raise an alert and cross-verify |
| Response truncation | Whether output is complete | Long-form text, JSON, code tasks | stop_reason normal and content complete |
Truncation that affects the business is an anomaly | Adjust max_tokens, re-check billing |
The thresholds in this table are only engineering starting points and should not be applied mechanically. Different workloads have different requirements for accuracy, cost, and latency, so thresholds should be tuned against historical data, the provider’s SLA, and your audit objectives.
8. Automated spot checks and compliance boundaries
If the relay is a long-term production dependency, turn these checks into a separate scheduled job. Run the fixed probe set periodically and record the following metrics into your log service and monitoring/alerting stack:
- Deviation rate between theoretical and actual usage;
- Model fingerprint match results;
- Knowledge-boundary test pass rate;
- Streaming versus non-streaming consistency;
- Time-to-first-token and token streaming speed profile;
stop_reasondistribution;- Truncation rate and structured-output parse failure rate.
This converts “am I being padded?” from a subjective impression into a traceable, quantified metric.
Engineering practice still has to respect compliance boundaries. Log collection should follow data-minimization and redaction principles, and should not capture sensitive business data unrelated to the audit. Detection activity should be limited to authorized auditing and acceptance testing of your own service; results should not be used to evade billing, circumvent third-party restrictions, attack services, or violate terms of service. If the matter involves enterprise procurement or a billing dispute, keep reproducible test scripts, request samples, timestamps, and statistics so the results can be reviewed independently.
9. Limitations, how to choose, and common questions
The conclusions of these four methods are probabilistic. A single run is not absolute proof; it requires multiple sampling rounds and cross-validation across methods. Tokenizers, model versions, and service routing all keep changing, so the probe set itself needs maintenance and updating. A sound supplementary practice is business-level validation on critical workloads — for example, answer correctness, whether structured output parses, and whether code actually runs.
Some guidance on choosing:
- Suspected model substitution: start with dirty tokens and knowledge-boundary probing;
- Suspected inflated billing: start with usage self-checking;
- Suspected truncation of long output: start with the response-truncation check;
- Need for long-term monitoring: use behavioral fingerprints to build a baseline;
- Provider acceptance testing: use the combined acceptance table.
Common questions
What is token watering-down?
It is an umbrella term for possible discrepancies in a relay’s billed usage, model tier, or response completeness. Common symptoms include inflated usage, model downgrade, and truncated responses.
How can I tell whether I am being padded?
Do not judge from a single response. Fix the parameters, run multiple tests, compare local token counts with the API’s usage, and combine model fingerprints, knowledge boundaries, and output completeness into one assessment.
What if streaming and non-streaming results disagree?
First confirm that the same prompt, the same parameters, and the same tokenizer were used. Then retest several times and check the concatenation logic, retry mechanism, caching, and stop sequences. If the inconsistency persists, treat it as a probable anomaly and investigate.
What if detection results are unstable?
First rule out load balancing, routing, non-deterministic implementations, and parameter differences. Then increase the sample size and record the full context of each request. Only when several dimensions are abnormal at the same time is it more appropriate to suspect padding or model substitution.
Overall, the core of detecting token watering-down in a relay is converting a vague “this feels wrong” into concrete measurements: does theoretical usage match, is the model fingerprint consistent, are the knowledge boundaries reasonable, is the output complete, and does long-term behavior stay stable. Master these four methods, combine them into routine spot checks, and you can protect billing transparency and service quality while keeping costs under control.
