Large Model API Billing Evolution: Search and Web Fetching Folded into Token Metering
This article examines a cloud provider's shift from per-request billing to token-based billing for server-side web search and page fetching triggered during large model calls. It breaks down the technical differences between the two billing models, the four components of cost under token metering, and the impact on AI Agent and RAG architectures. Readers will find practical cost-control techniques, a four-step migration plan, and common misconceptions to avoid when moving to token-based pricing.
1. Overview: From Per-Request to Per-Token Billing
A cloud provider has published a billing policy update on its official website: starting at 12:00 Beijing time on November 18, 2026, web search and page fetching triggered by the server side during model calls will no longer be billed separately. Charges will be settled solely based on the model’s token usage.
There are three typical scenarios that trigger server-side networking capabilities: first, the model’s built-in web tools; second, the web search tool declared in the compatible API system; and third, the search tool in conversational response APIs. These capabilities share a common trait: search and fetching happen on the server side, and from the caller’s perspective, it is a single model call rather than a separate retrieval request.
Before this change, the service offered standalone retrieval and fetching APIs billed per request at a fixed unit price per thousand successful requests. The retrieval API accepted query terms and returned structured web results, while the fetching API returned the title and body of a single URL organized in Markdown. Both APIs were built on a proprietary search engine and provided real-time web content for Agent and RAG applications.
From a product perspective, this is a merger of billing dimensions. From an engineering perspective, it reclassifies “external retrieval” from a standalone product into an auxiliary step of model inference.
2. Technical Differences Between the Two Billing Models
Per-request billing and per-token billing are not simply a matter of which is cheaper; they represent fundamentally different approaches to cost attribution.
Per-request billing is highly predictable: a single retrieval costs the same regardless of how much content it returns or how much the model subsequently consumes. Its drawback is that cost is decoupled from value—you pay the full fee even if you fetch ten pages and use only one paragraph, and a single search that hits the key evidence is severely mismatched between cost and benefit.
Per-token billing anchors cost to the amount of information actually processed by the model. Its advantage is clear attribution and strong correlation with context length. The risk is that token volume fluctuations in a single request get amplified into bill fluctuations, especially when long web pages are converted to Markdown and injected into the context.
For developers, the key takeaway is that a change in billing basis changes the optimization direction. In the per-request era, the goal was to “reduce the number of requests.” In the per-token era, the goal shifts to “controlling the scale and redundancy of injected context.”
3. Cost Breakdown Under Token Metering
Under the new policy, a call with networking capabilities consists of four main cost components:
- Prompt tokens: system instructions, tool declarations, and conversation history. Tool declarations and multi-turn history are often the main sources of long context.
- Retrieval result tokens: the portion of web page titles and bodies that enter the context after truncation or compression. This is the most volatile component.
- Model output tokens: including reasoning and the final response, usually priced higher than input.
- Retry and failure amplification: repeated calls caused by timeouts, parsing failures, or non-compliant content can multiply the first three components.
An illustrative call structure is shown below (for logic only, not a specific API):
messages = [{"role": "system", "content": SYSTEM_PROMPT + TOOL_SCHEMA},{"role": "user", "content": question},]# The server triggers retrieval and fetching on its own during inference,# and the fetched page content participates in this inference as contextresp = client.chat(messages=messages, tools=[web_search_tool])
The key implication of this code is that developers cannot precisely control “how many pages were fetched and how long each page is” the way they could with a standalone retrieval API. They can only indirectly influence token volume through prompt constraints, result count limits, and post-processing strategies.
4. Impact on Agent and RAG Architectures
Agent scenarios are affected most directly. A multi-step planning Agent may trigger retrieval in every round; historical context stacks with retrieval content, and token consumption grows approximately linearly or even superlinearly. The design should introduce context compression, staged summarization, and deduplication of retrieval results to avoid repeatedly injecting the same page across multiple rounds.
RAG scenarios require distinguishing between “self-built retrieval” and “server-side retrieval.” If an enterprise already has a vector database and document parsing pipeline, continuing with self-built retrieval keeps costs fully internalized, with server-side networking serving only as a fallback. If relying on server-side retrieval, reranking and truncation should be moved upstream so that only the Top-K snippets are sent to the model.
Reusable cost-control techniques include:
- Result trimming: limit the number of injected items and the body length of each, prioritizing summary paragraphs.
- Semantic deduplication: merge same-source or near-duplicate pages to reduce redundant tokens.
- Tiered caching: cache retrieval results for high-frequency queries and final answers for stable Q&A.
- Budget guardrails: set token and retrieval count limits per session, degrading to model-only answers when exceeded.
- Observability: use logging services and monitoring alerts to track token distribution by business dimension and locate abnormal amplification points.
5. Migration and Implementation Recommendations
The first step is to recalculate the cost baseline. Replay real traffic to measure the “average tokens per thousand sessions” before and after the change, rather than only looking at unit price, because the billing dimension has changed.
The second step is to refactor prompts and tool declarations. Streamline the system prompt, declare tools on demand, and avoid keeping lengthy descriptions resident in the context.
The third step is to establish a fallback path. When retrieval is unavailable or over budget, automatically switch to a no-networking answer and flag the information timeliness risk.
The fourth step is to improve evaluation. Build a regression set around factuality, citation completeness, and refusal rate to prevent sacrificing answer quality to save tokens.
6. Common Misconceptions
Misconception one: assuming that no separate charge means free. Retrieval content is still billed per token after entering the context, and long pages may cost more than per-request billing.
Misconception two: focusing optimization on request count. Under the new policy, request count is no longer the main cost driver.
Misconception three: ignoring output tokens. Verbose responses and explicit reasoning content are billed as well; compressing output is as important as compressing input.
Misconception four: lacking budget isolation. When multiple business lines share a key, a single anomaly can contaminate the overall bill; quotas and alerts should be split by business line.
7. Conclusion
The essence of this billing adjustment is turning web retrieval from a “separately sold API” into an “intrinsic part of model inference,” making cost attribution closer to actual resource consumption. For developers, the response is not to find a cheaper way to call the API, but to restructure context engineering: control injection scale, improve information density, and build caching and fallback mechanisms. In the general practices of cloud platforms such as Baidu AI Cloud, this combination of “usage-based billing + observability + budget guardrails” is becoming a standard approach for large model application cost governance.
