How to Detect and Prevent Fake LLM API Reselling
This guide explains why third-party LLM API resellers may secretly substitute cheaper models while still reporting the model you paid for, and how to detect it. It breaks down five common substitution patterns, including tier swaps, version swaps, cross-family swaps, mixed routing, and parameter downgrades. It then outlines a three-layer detection approach based on API contract checks, behavioral consistency evaluation, and observability with logging, along with practical procurement controls such as clear contracts, small-scale canary traffic, dual-channel redundancy, cost reconciliation, and capability abstraction. The goal is to turn information asymmetry into measurable verification so that switching channels becomes a configuration change rather than a code rewrite.
1. Background: The Model You Call May Not Be the One You Think
As LLM adoption accelerates, many developers and companies access model capabilities through third-party relay services instead of connecting directly to official APIs. Relay services are not inherently a problem. They can improve network reachability, unify billing, manage keys, and route requests across multiple models. But when the resale chain lacks transparency, a structural risk appears: the paying party buys a high-tier model, yet requests are silently routed to a cheaper tier while the API still claims to return the purchased model.
This behavior is commonly called “shell wrapping” or “adulteration.” The issue is not technical capability but service substitution under information asymmetry. Because chat outputs are highly open-ended, quality differences in a single response are hard for humans to judge reliably, which makes adulteration difficult to detect.
1.1 Why Adulteration Is Profitable
Prices across capability tiers often differ by multiples. Routing high-priced requests to a low-priced model can cut costs to a small fraction of the original, with no changes required to the interface or calling code. Profit motive combined with detection difficulty creates the economic basis for adulteration to persist.
1.2 Why It Is Hard to Detect
- Outputs are probabilistic text with no single correct answer, making line-by-line comparison impractical.
- Providers control response fields, error messages, and usage statistics. The “model name” the client sees is only a declared value.
- Adulteration can be dynamic, triggered only during peak hours, with long contexts, or on specific accounts, so sampled checks can miss it.
2. Common Adulteration Techniques
Understanding the techniques is a prerequisite for designing detection. In practice, the common patterns fall into five categories.
- Tier substitution: A smaller or lower-tier model answers high-tier requests while the model identifier in the API stays at the purchased tier.
- Version substitution: An older version is passed off as the current one, capturing a premium based on the vague expectation that “newer is stronger.”
- Cross-family substitution: A different model with similar capability but a different style is used, producing systematic deviations from the official style.
- Mixed routing: Requests are dynamically downgraded by load, time window, or account weight. Behavior looks normal most of the time and degrades at peak, distorting spot checks.
- Parameter downgrading: The model is unchanged, but the context window is compressed, maximum output length is reduced, or multimodal and tool-calling capabilities are disabled. This is a form of hidden downgrading.
The fifth category is often harder to detect than the first because it does not change model identity; it only reduces the capabilities actually available. The impact is especially visible in long-document processing and structured output scenarios.
3. Practical Detection Approaches
The goal of detection is not 100% certainty but narrowing uncertainty into a decision-ready range. Work across three layers.
Layer 1: API Contract Verification
First, check whether the service’s claims are consistent with actual responses, including the model identifier field, usage statistics fields, context length limit, supported call modes (streaming and non-streaming), and error code semantics. If declared capabilities conflict with actual behavior over time, for example claiming long-context support while truncating slightly longer inputs, treat it as a strong risk signal.
Layer 2: Behavioral Consistency Verification
Build an evaluation set with fixed inputs and scoring rules covering knowledge density, long-text reasoning, instruction following, structured output, and multi-turn consistency, and run it on a regular regression schedule. The key is “comparable under the same conditions”: fixed prompts, fixed decoding parameters, and a fixed time window, so randomness is not mistaken for adulteration.
A schematic evaluation skeleton is shown below (pseudocode, expressing the idea only):
cases = load_cases("eval_set.jsonl") # each entry has prompt, expected constraints, scoring dimensionsparams = {"temperature": 0, "max_tokens": 1024}def run(provider):scores = []for c in cases:resp = call_api(provider, c.prompt, params) # unified call wrapperscores.append(score(resp, c)) # rule checks + dimension scoringreturn aggregate(scores) # output mean and quantile distributionbaseline = run("reference_channel") # trusted baseline channelcurrent = run("candidate_channel") # channel under verificationreport_gap(baseline, current) # alert if the gap exceeds the threshold
The evaluation points are to set temperature to 0 or very low, use a sufficient sample size, and compare by quantiles rather than a single mean. Adulteration often shows up as a left shift in the distribution and long-tail degradation, while the mean can be masked by a few samples.
Layer 3: Observability and Trace Retention
Log the request fingerprint, response summary, latency, usage, and declared model value for every call, and combine them with monitoring alerts to form a trend view. If adulteration uses mixed routing, it usually leaves bimodal or abrupt traces in latency distribution, time to first token, and cost per unit of output. Without trace retention, any conclusion stays at the level of subjective impression.
4. Risk Control on the Selection and Procurement Side
Beyond technical detection, procurement constraints are often more effective.
- Clear contracts: Specify the model tier, context limit, downgrade policy, and notification mechanism in the service agreement, and prohibit downgrading without notice.
- Small-scale canary: Validate with a small traffic volume in parallel first, then ramp up gradually, avoiding a one-time migration of core business.
- Dual-channel redundancy: Keep a trusted channel as a baseline for continuous comparison and failover.
- Cost reconciliation: Reconcile actual usage against bills by business dimension. An abnormal drop in unit cost is often a leading indicator of downgrading.
- Capability abstraction: Wrap a unified model-calling interface at the application layer so switching channels requires no business code changes.
The value of unified wrapping is turning “model selection” into a configuration item, as shown below:
class ModelGateway:def __init__(self, adapters): # adapters: channel name -> adapterself.adapters = adaptersdef chat(self, channel, messages, **kw):return self.adapters[channel].chat(messages, **kw)# The business side depends only on a unified signature; channels are configurable, switchable, and regression-testable
5. Practical Advice for Different Roles
- Individual developers: Prefer access methods that are verifiable and leave traces. Be wary of services priced significantly below the market average, and run a first-round check with a fixed evaluation set.
- Enterprise teams: Bring model access into internal technical governance. Establish evaluation baselines, log auditing, and a vendor assessment process, and avoid depending on unverified channels as a single point of failure for critical business.
- Platforms and cloud providers: Help customers verify service quality through transparent model identifiers, clear downgrade notifications, and complete logging, monitoring, and alerting capabilities. Baidu AI Cloud’s approach to model services and general observability capabilities centers on “verifiable and traceable,” which is also the foundation for building industry trust.
6. Conclusion
The root of relay adulteration is information asymmetry, and the way to break it is to turn asymmetry into something measurable: clear contracts, fixed evaluations, complete trace retention, and switchable channels. When verification costs less than being deceived, adulteration naturally loses room to survive. For developers, building a lightweight but continuous regression verification mechanism is more valuable than pursuing accountability after the fact.
