cs.LGOct 27, 2026

API-TAIL: Detecting Model Substitution in LLM APIs through Temperature-Aligned Likelihood Tails

Authors: Haocheng Mei, Yuchuan Tian, Ye Yuan, Chao Xu, Allen Chen, Kai Han, Yunhe Wang

Organizations: TokenRhythm Technologies

Abstract

Commercial language model APIs return only text, allowing a provider to cut costs by quietly routing a fraction of user requests to a cheaper substitute model while billing for the advertised one. Detecting such partial substitution is challenging because honest providers also alter the output distribution through undocumented decoding and serving choices, such as temperature scaling, sampling truncation, repetition and presence penalties, and default system prompts, forcing an audit to test against a composite null of legitimate configurations rather than a single reference. Our key insight is that these legitimate variations primarily shift response typicality across the entire batch, whereas partial substitution injects individual responses that remain anomalous under the claimed model. Building on this, we introduce API-TAIL, a typicality audit that first absorbs batch-level shifts by aligning a single effective temperature to center standardized surprisal scores across the audited batch, and then flags the endpoint if the number of remaining tail responses exceeds a threshold calibrated across legitimate configurations. Evaluated on real-world API responses and constructed substitution mixtures, API-TAIL controls false alarms across diverse honest providers and detects low-rate partial substitution with a small query budget. Under a common composite calibration, it outperforms the adapted rank- and MMD-based audit baselines.

Figures & tables

Explore similar work

CardsList
  1. AgentProv: Auditing Agentic LLM API Providers via Tool-use Policy Probes

    Aug 30, 2026Xun Wang, Bihe Zhao, Michael Backes +2LLM AuditingLanguage Model Fingerprinting

  2. KBF: Knowledge Boundary as Fingerprint for Language Model and Black-Box API Auditing

    May 28, 2026Yijia Fang, Yiqing Feng, Bingyu Li +1LLM AuditingLanguage Model Fingerprinting