arXiv:2609.00710cs.DSSep 2026

Manuscript Offprint

arXiv:2609.00710

Prediction-Assisted Pricing and Admission for LLM APIs with Stochastic Token Consumption

Patrick Wong

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

An LLM application often sells or internally allocates several service products: a small or premium model, a short or long token cap, and possibly multiple posted prices. The operational decision is not merely which model answers a prompt. A price changes purchase probability, a token cap changes both user value and the tail of resource consumption, and accepted requests compete for shared compute and premium-model capacity. Demand and output length are initially uncertain, while an offline model may provide useful but imperfect predictions.

We formulate sequential pricing and admission with stochastic resource consumption. Each arriving request belongs to an observable segment. The platform chooses a product-price pair or makes no offer; purchase, revenue, and resource use are then random. An offline predictor supplies a uniform, validated error radius for every segment-product cell. We propose Prediction-Clipped UCB (PC-UCB), which intersects the offline prediction interval with an online confidence interval, evaluates products using resource shadow prices, and reserves a sample-path envelope before commitment. The prior gives a fast start when accurate, while online learning protects the platform when predictions are coarse.

The analysis is modular. On a simultaneous confidence event, regret against a buffered fluid benchmark is bounded by a pacing term plus the cumulative diameter of the intersected intervals. For JJ segment-product cells and prediction radius ε\varepsilon, this yields

O~(T+(1+Λˉ)min⁡{Tε,JT}),\tilde{O}\left(\sqrt{T}+(1+\bar{\Lambda})\min\{T\varepsilon,\sqrt{JT}\}\right),

where Λˉ\bar{\Lambda} bounds operational shadow prices. Thus the algorithm smoothly interpolates between an almost full-information regime and learning from scratch. Hard feasibility holds on every sample path through reservation envelopes.

Under a large but valid prediction-error radius, PC-UCB obtains 94.8% of oracle revenue, compared with 90.8% for a controller that never corrects its predictions and 82.5% for online UCB without a prior. The paper concludes with an identification and measurement protocol for real LLM API logs, including randomized menu experiments, censored token demand, and service-quality safeguards.

1 Introduction

Commercial and internal LLM platforms increasingly offer differentiated service rather than a single undifferentiated endpoint. A request can be processed by a small model, a premium model, a retrieval-augmented pipeline, or a tool-using agent. The platform may also choose a maximum output length, latency class, service-level guarantee, or posted price. These choices jointly determine user value and system load. A premium long-context response may command a higher price, but it also creates a heavier and more variable token workload. Selling too many such requests early can crowd out later requests with higher willingness to pay.

This creates an online revenue-management problem with a feature that is especially important for generative models: resource consumption is not known when the offer is made. Output length depends on the prompt, sampling settings, stopping behavior, and whether the user accepts the offer. A service can reserve a worst-case token envelope, but planning only with worst cases is unnecessarily conservative. It can plan using expected consumption, but then it needs a separate mechanism to prevent a rare long response from violating physical capacity. The correct architecture therefore separates economic planning from sample-path admission.

Learning is equally central. A new product may have no reliable demand curve. Even for an existing product, a model update can change completion quality, user acceptance, and token length. Yet platforms often possess an offline predictor built from benchmark scores, historical cohorts, survey data, or a launch experiment. Such a predictor should not be discarded. Nor should it be trusted indefinitely. What is needed is a controller that exploits a validated prediction while retaining the ability to learn away its residual error.

We study this problem through a finite product menu. Each action combines a model tier, a token cap, and a price. A request arrives with an observable segment; the platform chooses one action or makes no offer. If the request purchases, the platform receives the posted price and observes a random resource vector. The resource coordinates can represent expected GPU-seconds, premium-model capacity, cached-context bandwidth, external API spend, or a service-level budget. This discrete menu is already rich enough to expose the interaction between pricing, model allocation, and token reservation. Continuous prices can be handled by discretization or a demand model, as discussed later.

Our algorithm, Prediction-Clipped UCB (PC-UCB), combines three ideas. First, the offline model gives an interval rather than a point estimate. Second, online observations give a conventional statistical confidence interval. Their intersection is never wider than either source alone. Third, a vector of shadow prices converts expected resource use into an internal marginal cost. The controller offers the product with the largest confidence-adjusted revenue net of resource charges, subject to a reservation meter. A projected dual update raises the internal price of an overused resource and lowers it when capacity is underused.