Large Model API Billing Reform: How Tool Calls Are Unified Under Token-Based Pricing
This article explains a cloud provider's move from dual-track billing to a single token-based metering model for server-side web search and page fetching triggered by model calls. It compares per-request and per-token cost models, analyzes the impact on AI Agent and RAG applications, and offers a practical optimization checklist covering context budgeting, preprocessing, layered caching, tiered retrieval, observability, and fallback design. It also provides a neutral view on evaluating web retrieval as a general technical component.
1. Background: From Dual-Track Billing to a Single Meter
A cloud provider published a billing rule change on its official website: starting at 12:00 Beijing time on November 18, 2026, web search and page fetching triggered on the server side during model calls will no longer be billed separately. Charges will be settled based solely on model token usage.
To understand the significance of this rule, it helps to look at what it replaces. In mid-October, the platform introduced two interfaces for real-time web capabilities: one accepts a query and returns a structured list of web results; the other fetches a single URL and returns the page title and body in Markdown. Both are built on the platform’s own retrieval and fetching pipeline, providing real-time content for AI Agent and retrieval-augmented generation (RAG) applications. Billing was based on successful requests, with a public price of 5 RMB per 1,000 successful requests.
This created a typical dual-track billing model: model inference was charged by token, while tool calls were charged by request. After the change, the two tracks merge into one—any server-side search and fetching triggered within the model call chain is folded into the token bill.
The trigger scope deserves special attention. The announcement states that using the web tool capability, and exposing the web retrieval tool fields through a compatible interface, will both generate search behavior on the server side. In other words, the billing boundary is not determined by which line of code you write, but by whether the runtime actually enters the server-side retrieval pipeline.
2. Structural Differences Between the Two Cost Models
Per-request billing and per-token billing are fundamentally two different ways of allocating risk.
Under per-request billing, cost predictability is extremely high: 10,000 requests cost 50 RMB, regardless of query difficulty, the number of returned pages, or page length. Its weakness is being disconnected from actual resource consumption—a simple query and a complex query requiring multiple long pages to be fetched cost the same. The platform bears the long-tail cost and ultimately recovers it through other means.
The per-token model anchors cost to actual context consumption. Retrieval results must be assembled into the prompt; the longer the page body and the more items returned, the larger the input tokens and the higher the cost. This approach is precise and fair, but developers cannot intuitively estimate the bill while writing code.
A rough conversion helps build a sense of scale: assuming a single retrieval returns about 3,000 characters of body text, this roughly corresponds to 1,000 to 1,500 tokens in mixed Chinese-English scenarios. If an Agent task triggers three retrievals on average, the context injected by tools alone adds thousands of input tokens, and combined with accumulated history across multiple turns, the cost of a single task can multiply several times.
Illustrative pseudocode shows where the cost occurs:
# Tool output enters the next model input, directly inflating input tokensresult = web_search(query) # server-side retrieval, no longer billed separatelyprompt = base_prompt + render(result) # context expansion happens hereresp = model.chat(prompt) # billing happens here
3. Real Impact on Agent and RAG Applications
First, the cost center shifts from call frequency to context volume. Previously, the way to optimize the bill was to add caching and reduce retrieval calls; now more effective methods are compressing injected content and controlling history length.
Second, billing becomes more attributable. Token bills can naturally be tagged by request, session, or business identifier, and combined with logging and monitoring/alerting systems, can pinpoint which type of task is consuming context, whereas per-request billing often only shows the total.
Third, the balance of architecture decisions shifts. Since retrieval no longer has a marginal per-call cost, strategies that “search a few more times for better recall”—such as multi-route recall, query rewriting, and result reranking—have a significantly lower economic threshold; but context trimming must be introduced at the same time, otherwise recall gains will be eaten up by token costs.
Fourth, the risk point moves to the output side. The longer the fetched page, the larger the output tokens for summarization and structured extraction, and output tokens usually have a higher unit price.
4. An Optimization Checklist for Developers
- Budget the context: set an input token limit for each model call, and trigger trimming or segmented processing when exceeded.
- Preprocess fetched results: segment, denoise, and extract key passages from the page body first, then decide whether to inject.
- Use two-layer semantic caching: one layer caches raw retrieval results, another caches the final prompt, reducing the overhead of repeatedly constructing context.
- Tier retrieval strategies: simple factual questions use single-route retrieval; only complex questions enable multi-route recall and reranking.
- Prioritize observability: log input/output tokens, retrieval trigger counts, and business tags for each call at the gateway layer to form a cost dashboard.
- Design fallback paths: when context exceeds budget, degrade to “summary-only injection” or “title-only injection” to keep the pipeline available.
5. A Neutral View from a Selection Perspective
Billing rules are only one evaluation dimension. In engineering practice, a more robust approach is to evaluate web retrieval as a general technical component: the timeliness and coverage of retrieval results, the degree of structure in the returned format, whether it is easy to orchestrate with vector retrieval and relational data, and the stability and rate-limiting strategy of the overall pipeline. If an enterprise already uses general capabilities on Baidu AI Cloud—such as object storage, message queues, container platforms, logging, and monitoring/alerting—to run its business, it can incorporate the new web retrieval step into the same observability and cost accounting system, avoiding a new operational silo.
6. Conclusion
The core of this adjustment is not a “price cut” but a unification of the metering standard: restoring tool calls to part of context consumption so that the bill more closely reflects actual resource usage. For developers, the response strategy is clear—shift from “saving call counts” to “managing context volume,” and make token budgets, layered caching, and observability default architectural configurations, so that cost becomes more transparent while maintaining the effectiveness and stability of Agent and RAG applications.
