Large Model API Billing Shifts to Pure Token-Based Pricing for Web Search
This article explains why a major model service provider replaced per-request billing for server-side web search and page fetching with pure token-based pricing just 18 days after introducing it. It covers the structural cost problems of per-call billing in agent applications, the technical implications of a single billing variable, and practical strategies for developers to control costs by managing context size, caching, tiered web access, and observability. It also offers guidance on choosing between standalone search APIs and built-in model web capabilities.
1. What Happened: A Billing Policy That Lasted Only 18 Days
A large model service platform recently published a billing policy update on its official website: starting from the effective time of the announcement, web search and page fetching automatically triggered by the server during model calls are no longer billed separately. These costs are now merged into the model’s token usage.
Notably, the per-request billing rule itself was in place for only a very short time. About a month ago, alongside a model version update, the platform officially opened search and fetch APIs based on its in-house retrieval capabilities. Both APIs were priced at 5 RMB per 1,000 successful requests, with a transition period of roughly two weeks during which server-side tool calls in an intelligent coding tool were not billed. Only after that did per-request charging formally begin. In other words, only 18 days passed between the start of official billing and its cancellation.
It is important to distinguish that this adjustment targets “retrieval and fetching automatically triggered by the server during model calls.” Standalone search and fetch APIs are unaffected and still billed per 1,000 successful requests. For developers, this means the cost models of the two invocation paths are now completely separated.
2. Why Per-Request Billing Easily Spirals Out of Control in Web-Enabled Scenarios
To understand the value of this adjustment, first examine the structural problems of per-request billing in agent-style applications.
1. The number of calls is decided by the model, not the developer
In a web tool-calling pipeline, whether to retrieve, how many retrieval rounds to run, and how many pages to fetch per round are typically decided by the model during reasoning. The developer submits a single user request, yet the backend may generate a multiplied number of tool calls. Cost predictability is therefore weakened.
A schematic call chain looks like this:
User query└─ Model reasoning (billed by tokens)├─ Trigger retrieval -> fetch several pages (billed per request)├─ Insufficient results -> retrieve again (billed per request again)└─ Summarize and generate answer (billed by tokens)
2. Failures and retries amplify bill uncertainty
Network timeouts, anti-scraping mechanisms, and empty returned content are very common in the fetching stage. If the billing basis is coupled with success counts and retry strategies, bill fluctuations become significantly amplified, making capacity planning and budget approval difficult to advance.
3. More billing dimensions mean more complex cost accounting
Per-request billing means the bill contains two independent variables at the same time: “tokens” and “request counts.” When building a unit economics model, developers need to separately estimate retrieval hit rates for each business scenario, making it nearly impossible to provide stable quotes.
3. The Technical Implications of Returning to Pure Token-Based Billing
After removing per-request billing, the cost structure of web-enabled calls is simplified to a single variable: a request is measured only by token consumption. This change brings three layers of benefits.
First, costs become predictable. Input context, retrieval result summaries, and output content are all converted into tokens, allowing developers to estimate the cost of a single session with a unified formula.
Second, architecture decisions become more straightforward. Whether to let the model retrieve one more round can be judged purely on effectiveness, without compromising between effectiveness and cost.
Third, bills become attributable. Token usage can be tagged and aggregated by business line, by API, and by user dimension, making cost allocation and quota policies easier to implement.
It should be emphasized that pure token-based billing does not mean retrieval results consume no cost. Fetched web page content enters the model input as context, which is reflected as growth in input tokens. The real cost lever shifts from “number of calls” to “context length control.”
4. Developer Response: Shift Cost Optimization Focus to Context
1. Control the scale of injected context
Perform structured extraction and truncation on fetched results first, keeping only paragraphs relevant to the question and avoiding feeding full page text directly into the prompt.
def build_context(pages, query, max_chars=4000):picked = []for p in pages:text = extract_main_text(p) # remove navigation, ads, and other noisepicked.append(rank_by_relevance(text, query))merged = "\n\n".join(picked)return merged[:max_chars]
2. Use caching to reduce repeated retrieval
Build a retrieval result cache for high-frequency questions. On a cache hit, reuse the summary directly, reducing both tool calls and input tokens.
3. Tiered web access strategy
Set thresholds: do not go online when a local knowledge base or cache can answer; when online access is required, limit the maximum number of retrieval rounds and fetched pages to prevent cost divergence for a single request.
4. Improve observability
In the logging service and monitoring/alerting system, add instrumentation for input tokens, output tokens, and retrieval rounds separately, forming a cost dashboard by scenario and setting budget alert thresholds.
5. Choosing Between Standalone Retrieval APIs and Built-in Model Web Access
The two capabilities have different positioning and should be selected by scenario:
- When you need precise control over search terms, ranking strategies, and returned fields, or need to feed retrieval results into your own model and vector store, a standalone retrieval API is more suitable, with costs based on successful requests.
- When you only need an end-to-end answer with citations and want to simplify billing and operations, built-in model web capabilities are more convenient.
A common combination is: offline batch tasks use the standalone API for corpus construction, online question answering uses built-in model web access, and both are routed and quota-managed through a unified gateway.
6. Conclusion
This per-request billing adjustment, which lasted only 18 days, is essentially a convergence of billing basis: merging the unpredictable “count” variable back into the measurable and attributable “token” variable. For developers, the optimization focus going forward is no longer saving call counts, but compressing context, improving cache hit rates, and building a cost observability system. In the general practices of cloud platforms such as Baidu AI Cloud, combined with foundational capabilities like object storage, message queues, logging services, and monitoring/alerting, this cost-controllable web-enabled application pipeline can be built out fairly completely.
