Large Model Web Access Billing Switches to Pure Token-Based Pricing: What Changed and Why
This article analyzes a cloud provider's decision to stop charging per call for server-side web search and page fetching during large model inference, folding that usage into token-based billing instead. It explains why per-call pricing was a poor fit, how the cost model shifts from two dimensions to one, and the practical impact on application architecture. Readers will find updated cost estimation logic, a context budgeting function, and an engineering checklist covering caching, observability, cost guardrails, and fallback behavior.
1. Overview: A Pricing Change That Lasted Only 18 Days
A cloud provider’s large model platform recently announced on its official website that, starting at noon on a given day, web search and page fetching automatically triggered by the server during model calls would no longer be billed separately. Instead, all of it would be folded into model token usage settlement. The per-call pricing rule had only just been introduced: in mid-October, alongside a minor version release of a model, the platform opened search and fetch interfaces based on its in-house retrieval capability, priced at five yuan per thousand successful requests, with a two-week transition period during which server-side tool calls in the intelligent coding tool were not charged. Per-call billing formally took effect in early November. In other words, per-call billing ran for only 18 days before being canceled.
Two capabilities need to be distinguished. The first is the standalone retrieval and fetch interfaces that developers invoke explicitly, which are still billed per successful request. The second is the retrieval and fetching initiated automatically by the server during model inference, which is no longer billed separately. This article focuses on the latter, since it has the most direct impact on the vast majority of applications.
2. Why It Was Canceled: From Tool Billing Back to Usage Billing
Per-call billing carried a semantic mismatch. Developers purchase “generation capability,” while retrieval is an internal action the model decides on its own in order to complete generation. The number of calls is determined jointly by model policy, prompts, and question difficulty; developers cannot predict it before sending a request and can hardly reconcile it afterward. This creates three engineering problems:
- Unpredictable cost: the per-request cost of the same business can differ by several times across dates, distorting budget and gross margin models.
- Unattributable billing: a single question-and-answer exchange may trigger zero to multiple retrievals, with no stable allocation basis.
- Distorted optimization direction: developers tend to suppress retrieval to save money, sacrificing the timeliness and accuracy of answers.
Canceling per-call billing and merging it into token billing essentially converges the uncertain “count” back onto the relatively observable “usage,” returning the cost structure to a single dimension.
3. How the Cost Model Changes: From Two Dimensions to One
The expression for single-request cost differs noticeably before and after the adjustment:
Before: Cost = Token_in * P_in + Token_out * P_out + N_search * P_search + N_fetch * P_fetchAfter: Cost = Token_in' * P_in + Token_out * P_outWhere Token_in' = Token_in + ΔRetrieved
The key variable is ΔRetrieved: the incremental input tokens produced when retrieval results are stitched into the context. This means the “real price” of retrieval is determined by the length and number of retrieved results and whether they are repeatedly referenced, rather than by the number of calls. The direct engineering implication is that controlling context bloat is controlling cost.
An illustrative estimation logic (the values are for demonstration only and are not any platform’s real pricing):
def estimate(req_tokens, retrieved_docs, avg_doc_tokens, p_in, p_out, out_tokens):delta = retrieved_docs * avg_doc_tokensreturn (req_tokens + delta) * p_in + out_tokens * p_out
4. Four Practical Impacts on Application Architecture
- Improved cost predictability. Capacity planning can be modeled purely on token throughput, and the retrieval layer degrades from a “billing item” to a “performance item.”
- Context budget becomes a core constraint. Overly long retrieval snippets push up both cost and time-to-first-token while squeezing the effective attention window.
- Caching gains value. Since retrieval cost is reflected in tokens, the benefit of a cache hit is saving the entire block of context tokens.
- Load testing metrics need updating. The old “cost per thousand retrievals” metric should be replaced with “average context tokens per thousand requests.”
5. Engineering Implementation Checklist
Apply budget control on the side where retrieval results are injected:
def build_context(query, docs, budget=3000):picked, used = [], 0for d in sorted(docs, key=lambda x: x["score"], reverse=True):t = min(d["tokens"], budget - used)if t <= 64:breakpicked.append({"text": d["text"][:t], "score": d["score"]})used += tif used >= budget:breakreturn picked, used
Recommended supporting measures include:
- Tiered caching: route exact matches to a key-value cache and semantically similar queries to a vector retrieval cache, with explicit TTL and invalidation policies.
- Observability: separately record input/output tokens, the share of tokens from retrieval snippets, cache hit rate, and P95 latency triggered by retrieval.
- Cost guardrails: set a context limit per request and a tenant-level daily quota, automatically degrading to “answer from local knowledge only” when approaching the threshold.
- Quality fallback: keep a forced retrieval switch for time-sensitive questions to avoid sacrificing correctness to save money.
- Result compression: deduplicate first, then truncate by relevance, and summarize before injection when necessary.
6. Common Misconceptions
- Assuming “free” means no cost: retrieval still consumes tokens and latency.
- Expanding context without restraint: marginal benefit decays quickly while cost and noise rise together.
- Ignoring standalone interface billing: explicitly invoked retrieval interfaces are still charged per call, and the two pricing schemes must be accounted for separately.
- Lacking a fallback path: when the retrieval service fails, the system should fall back to pure model answering and clearly inform the user.
7. Conclusion
This adjustment converges the cost of web access back into a single dimension, reducing the complexity of budgeting and billing and shifting the optimization focus from “retrieve less” to “retrieve precisely.” Three things developers should do now: recalculate the token cost per request, set a hard budget for retrieval context, and fill in observability metrics for the token and cache dimensions. If you use Baidu AI Cloud’s related model services, it is likewise advisable to build cost governance and fallback mechanisms around a token budget.
