Search and Fetch Billing Merged into Token Usage: How to Estimate Your Budget

    This article explains the shift from per-call search and web fetch fees to token-based billing, identifies which server-side calls trigger retrieval, provides formulas and a comparison table for estimating old versus new costs, and offers practical ways to monitor usage and prevent hidden token growth.

    Conclusion first: server-side search and web fetch are no longer billed per call. Their costs are now counted toward model token usage. The interfaces themselves remain available, and the search fee will disappear from the bill, but context tokens may increase significantly. Developers need to evaluate changes in token usage, not just the number of API calls. The exact effective date and unit prices are subject to the applicable cloud provider’s official announcement; the prices in this article are only calculation examples.

    1. What the Old Two-Track Billing Looked Like

    In many API services, large model calls and external data retrieval are billed separately. For retrieval-augmented generation (RAG) and agent applications, for example, developers pay token fees for each model inference and also pay for search calls or web fetch calls. This model has clear responsibility boundaries, but it creates two practical problems. First, costs are hard to predict because a single task may trigger multiple implicit searches. Second, bills contain many line items and are cumbersome to reconcile. In multi-turn conversations and complex task chains, implicit calls can easily push costs beyond expectations.

    After the adjustment, search and fetch fees are no longer listed separately. They are merged into model token usage. The billing unit changes from “API calls” to “number of tokens.”

    According to the official documentation, the following three cases invoke server-side web retrieval.

    The first is model-initiated triggering. When a user asks a question with real-time requirements, such as “What is the weather today?” or “What has happened in a certain industry over the past week?”, the model may determine that its own knowledge is not current enough and call the background web retrieval module. This judgment is made by the model, and developers usually do not need to configure extra parameters.

    The second is explicitly declaring web_search in a tool-calling protocol. After the developer enables this tool in the request, the model can call the search interface directly when needed and obtain structured results.

    The third is a native call by the model in a response API. As part of the model’s response capabilities, web_search can retrieve in parallel while generating a reply and write the results directly into the final output.

    For the specific behavior and billing details of different integration methods, refer to the relevant platform documentation. The common point of these three paths is that search happens on the server side. Developers do not need to manage search credentials or handle callback states. Because of this, search calls are not easy to notice and require dedicated inspection.

    3. How to Estimate the Difference Between Old and New Costs

    Under the old rules, the API fee is simple to calculate:

    Old API fee = successful calls ÷ 1,000 × unit price

    Using the example price of CNY 5 per 1,000 successful requests, the API fee for 5 fetches is 5 ÷ 1,000 × 5 = CNY 0.025.

    Under the new rules, the API fee is zero, but the added context tokens are billed at the model unit price:

    Added cost ≈ added input tokens ÷ 1,000,000 × input unit price + added output tokens ÷ 1,000,000 × output unit price

    The following comparison uses hypothetical data. Assume the input unit price is CNY 2 per million tokens, for demonstration only.

    Scenario Old API fee Assumed added input tokens Added input cost Conclusion
    Fetch 5 web pages, about 3,000 tokens per page CNY 0.025 15,000 CNY 0.030 New cost slightly higher
    Fetch 3 web pages, each truncated to about 1,000 tokens CNY 0.015 3,000 CNY 0.006 New cost clearly lower
    1 search, returning about 800 tokens of snippets CNY 0.005 800 CNY 0.0016 New cost lower

    The table suggests a decision criterion. At the assumed unit prices above, once a call adds about 2,500 tokens, its cost is roughly equal to the old per-call fee (CNY 0.005). If the added tokens exceed that amount, the new rules are more expensive.

    Two caveats matter. First, the table only counts added input tokens. A real comparison must also include the model’s own output costs, and the baseline output volume should remain consistent between the old and new schemes. Second, the length of search results, summary length, and truncation strategy determine how many tokens are added. Conclusions can vary widely across applications, so you should plug your own real logs into the formula.

    4. Why Token Billing Better Reflects Actual Consumption

    Once web content enters the context window, the model must process that text token by token. Even if the final output does not use it, the reading and encoding computation still consumes resources. Under the old rules, this consumption was treated as a hidden cost outside the “API fee” and was invisible on the bill. With token billing, the costs of search, fetch, understanding, and reasoning all fall under the same metric, bringing the bill closer to actual computation.

    For developers, cost accounting also becomes simpler. Tracking input and output token counts is enough for most budget estimates, without separately tracking search and fetch counts. But this also means that costs formerly determined by API call counts are now mainly determined by context length.

    5. How to Avoid Hidden Token Spikes

    First, review search trigger frequency. Developers should inspect the code to confirm that web_search is not called unexpectedly or repeatedly. Pay particular attention when processing batches of data in loops. Add a cache layer between iterations. A cache key should ideally combine the query term, time window, and region to avoid repeated retrieval for the same question.

    Second, truncate fetched content. The body text returned by Fetch may contain thousands of tokens. The application layer can truncate the body to a fixed threshold, such as 2,000 to 4,000 tokens, or first use a cheaper model to generate a summary and then pass the summary to the main model. The truncation threshold should be determined through task quality testing, not cost alone.

    Third, set up usage monitoring and alerts. Because search is triggered by user questions, usage may rise suddenly. Monitor the following metrics:

    • Input tokens per request
    • web_search trigger rate, meaning the proportion of requests per hundred that trigger search
    • Share of Fetch calls in total requests
    • Token usage by day or hour, compared with the previous period

    Set thresholds for each metric and alert promptly when they are exceeded, so you can identify which types of requests caused the anomaly.

    6. Similar Changes in the Industry

    Over the past two years, large model API pricing has generally moved from pure resource billing toward more consolidated usage billing. Some providers are also including data retrieval capabilities in model usage rather than offering them as separately charged add-on services. This change makes the cost of agent and RAG applications depend more on the amount of text processed by the model and less on the number of API calls. Therefore, when designing architectures, developers should pay attention not only to retrieval quality but also to context compression efficiency.

    7. What to Do Next

    For teams already using search and fetch capabilities, start with real logs from the past month. Count search calls, fetch calls, and input tokens per request, then apply the formulas in this article to calculate the difference between old and new costs. If the new cost rises significantly, prioritize truncating fetched content and adding caching. Billing rules may continue to change, pricing is subject to official announcements, and cost assessments should be reviewed regularly.