Understanding LLM Subscription Billing: Reverse-Engineering Usage Quotas from Floating-Point Numbers
In subscription-based LLM services, users typically see only vague marketing claims like "5x the usage," while real quotas remain a black box. This article examines a case where a developer reverse-engineered a platform's true credit limits from an unrounded 17-digit floating-point number returned by an API, and systematically explains how LLM subscription billing works, along with general methods for estimating quotas and choosing the right plan.
In subscription-based LLM services, users usually see only vague marketing claims such as “several times the usage,” while the actual quota remains a black box. Interestingly, a developer once successfully reverse-engineered a platform’s true billing quota from a string of unrounded floating-point numbers returned by an interface, exposing hidden details in subscription plan design. Using this case as a starting point, this article systematically explains LLM subscription billing mechanisms and provides general methods for estimating quotas and selecting plans.
1. A Classic “Data Leak”: Case Review
1.1 The Suspicious Floating-Point Number
While using a web-based AI coding tool, a developer noticed that the usage data returned contained a floating-point number with 17 decimal places, looking something like this:
0.16327272727272726
This number was suspiciously precise. Normally, user-facing data is rounded to two or three decimal places. This level of precision usually indicates a raw result of fractional arithmetic that was passed to the frontend without formatting.
1.2 Recovering the Fraction with Mathematical Tools
The developer used a classic mathematical method—the Stern-Brocot tree (a fraction approximation approach related to Farey sequences)—to reverse-engineer the most likely original fraction from this floating-point number. The core idea of the Stern-Brocot tree is that any positive rational number can be precisely located by repeatedly taking mediant fractions between an upper-bound fraction and a lower-bound fraction.
A simplified continued-fraction expansion approach looks like this:
def to_fraction(x, max_denominator=10**6):# Rational approximation based on continued fraction expansionfrom fractions import Fractionreturn Fraction(x).limit_denominator(max_denominator)print(to_fraction(0.16327272727272726))# Outputs an exact fraction such as 27/165
By cross-validating multiple samples, the developer reconstructed the real quota values of the platform’s internal “credits” system. Pricing details the platform had never disclosed were leaked by a few unrounded decimals.
1.3 Lessons from the Incident
This incident illustrates two points. First, the transparency of a billing system depends on implementation details—a single unformatted number can expose all internal parameters. Second, as users, we are fully capable of quantitatively evaluating the real value of a subscription service using data returned by public interfaces, rather than passively accepting marketing claims.
2. The General Architecture of Subscription Billing
To understand this type of incident, you first need to understand the typical design of subscription-based billing.
2.1 Internal Pricing Units
Mainstream LLM services generally adopt a unified internal pricing unit (referred to here as credits) rather than billing directly per token. Different models consume credits at different rates, typically following these patterns:
- The more capable the model, the more credits consumed per token—commonly at ratios of 1.5x to 5x;
- Output tokens are usually priced higher than input tokens, with an industry-typical gap of 3x to 5x;
- Subscription quotas reset on a rolling basis at fixed intervals (e.g., every 5 hours or weekly).
The benefit of this abstraction is that the platform can flexibly adjust cost coefficients for each model in the backend without changing the user-facing plan structure.
2.2 Three Layers of Quota Limits
Subscription plans typically stack multiple layers of limits:
- Short-cycle quotas: e.g., available usage within a 5-hour window;
- Long-cycle quotas: e.g., weekly caps that prevent sustained full-load usage;
- Concurrency and rate limits: controlling instantaneous request frequency.
The “5x usage” claim in marketing often corresponds to only one of these layers, while the others may not scale proportionally. This is precisely the source of the gap between the “nominal multiplier” and the “real multiplier.”
3. How to Quantitatively Evaluate the Real Value of a Subscription Plan
3.1 Establish a Baseline
Take the entry-level plan as the baseline and record its available usage over short and long cycles. You can construct a simple conversion table:
Value multiplier = target plan quota / baseline plan quotaActual cost-effectiveness = value multiplier / price multiplier
If the actual cost-effectiveness is greater than 1, the plan “gives more” relative to the baseline; if less than 1, it implies a premium.
3.2 Data Collection Methods
- Capture the usage fields returned in client-server communications, paying attention to unrounded floating-point numbers;
- Sample multiple times and use the greatest common divisor or fraction approximation to determine the granularity of the internal unit;
- Run calibration experiments with controlled request volumes—for example, send requests with known token counts, observe credit consumption, and derive the unit conversion ratio.
# Calibration example: estimating credits consumed per tokenused_credits = 55_0000known_tokens = 33_0000rate = used_credits / known_tokens # Get the consumption coefficient per token
3.3 Choose a Plan Based on Your Usage Profile
When evaluating, you should analyze your actual usage distribution:
- Daily active hours and request counts;
- Distribution of model tiers used (a high proportion of heavy models means faster consumption);
- Input-to-output ratio (long contexts and multi-turn conversations significantly increase input consumption).
If your usage is concentrated in peak hours and frequently hits the cap, higher-tier plans usually offer better real cost-effectiveness. For light usage, pay-as-you-go API billing may actually be more economical.
4. Recommendations for Both Platforms and Developers
4.1 For Platforms: Transparency Is a Long-Term Competitive Advantage
Billing black boxes protect pricing flexibility in the short term but erode trust in the long run. Better practices include: publishing internal pricing units and conversion ratios, providing verifiable quota descriptions for each plan, and consistently formatting displayed data. Greater transparency lowers users’ decision costs and can actually drive conversion to higher-tier plans.
4.2 For Developers: Build Quantitative Habits
- Don’t trust marketing multipliers blindly—let measured data speak;
- Pay attention to cycle reset rules and schedule heavy tasks at the start of a quota window;
- Build your own usage monitoring: persist returned data and visualize it to detect consumption anomalies early;
- When building applications in the cloud, prefer cloud services that offer clear metering definitions and itemized billing, and combine them with logging services and monitoring/alerting systems for fine-grained cost control.
5. Conclusion
A 17-decimal floating-point number tore open a corner of subscription billing and reminds us that any “black box” reveals its boundaries under sufficiently careful observation. For developers, mastering fundamental methods like fraction approximation, calibration experiments, and usage statistics not only reveals the true value of subscription plans, but also transfers to everyday architecture and cost optimization work—ensuring every budget dollar is spent on quantifiable value.
