Free Web Search Tool Calls for LLMs: Estimating the Cost of 1,000 Queries

    This article explains why waiving tool call fees for built-in web search does not make search free. It compares the token costs of built-in web search with those of external Search and Fetch APIs, walks through a cost estimate for 1,000 Q&A tasks, and offers guidance on architecture choices and cost optimization.

    A major LLM platform has announced that it will open the search, file parsing, and voice capabilities of its app through its API. From a specific date, the platform will also stop charging tool call fees for server-side search and web page fetching triggered during model calls. The change drew wide attention in the developer community, and many people read it as “web search is now free.” A closer look at the technical architecture and billing logic, however, shows a significant difference between “no tool fee” and “free search.” When estimating costs, developers must calculate model token fees and tool call surcharges separately. This article breaks down the two main ways to implement web search and works through a concrete scenario to show how to calculate the total cost.

    1. Clarifying the Core Misconception: The Tool Fee Is Waived, Not the Token Fee

    In LLM-based Q&A, there are two main technical approaches. Their billing logic differs sharply, which makes them easy to confuse.

    Approach 1: Built-in web search tool. The model decides on its own whether it needs outside information. When it does, it automatically runs a web search and opens pages to fetch their content. Under the new policy, this trigger-and-fetch action is no longer charged separately. However, the fetched material is fed to the model as context and becomes part of the input for later reasoning and generation. These additional context tokens are still billed as usual.

    Approach 2: External API integration. Developers write code that calls a general-purpose Search API to get result summaries, then calls a Fetch API to retrieve the body text of target pages. These external APIs usually bill per successful request. For example, the rate might be 5 yuan per 1,000 successful requests, with failed or timed-out requests not charged. The retrieved text is then concatenated into the prompt sent to the model, and the model’s inference tokens are billed separately.

    Comparing only the input price per million tokens is therefore meaningless. To judge whether a web-enabled Q&A business is expensive, developers must consider model fees, search fees, and fetch fees together on one bill.

    2. Cost Estimate for Built-in Web Search: 1,000 Q&A Tasks

    To make the costs concrete, this example uses a lightweight Flash-tier model that supports built-in web search. Model platforms typically split billing into time periods based on server load, such as “peak hours” and “off-peak hours.” Assume the model’s current official pricing, in yuan per million tokens, is as follows:

    Table 1: Model pricing (yuan per million tokens)

    Billing item Off-peak Peak
    Uncached input 1 2
    Cache-hit input 0.02 0.04
    Output 4 8

    Note: Peak hours generally refer to core weekday business hours. All other times, including public holidays, count as off-peak.

    Assume the business runs 1,000 independent web-enabled Q&A tasks. Based on past experience, each task consumes an average of 6,000 uncached input tokens and 1,000 output tokens. The input covers the system prompt, the user’s question, and the context from fetched web content. The output covers the reasoning process and the final answer.

    Assuming no retries and no other paid services, the 1,000 tasks consume 6 million input tokens and 1 million output tokens in total. Because the built-in web search tool is used, the tool call fee is zero.

    • Off-peak model cost: 6 × 1 + 1 × 4 = 10 yuan
    • Peak model cost: 6 × 2 + 1 × 8 = 20 yuan

    Spread across each task, the cost is roughly 0.01 to 0.02 yuan per query. The 6,000 input tokens cover all billable input for the entire task. They are not just the few words of the user’s opening question. Whether the model triggers a web search, and how many pages it fetches, depends on task complexity and the model’s own decisions. Developers should verify actual usage through their call logs.

    3. Cost Comparison with the External API Approach

    Developers who want more control over search results may choose the second approach and implement Search and Fetch APIs in their own code. Under the same assumptions (1,000 tasks, each with 6,000 input tokens and 1,000 output tokens), the cost structure changes significantly.

    First, the external API request fees. Assume each Q&A task needs one search request and one fetch request on average. At 5 yuan per 1,000 requests, the API request fees for 1,000 tasks come to 10 yuan.

    Second, the model inference fees. These match the built-in approach: 10 yuan off-peak and 20 yuan at peak.

    In total, the external API approach costs about 20 yuan off-peak and about 30 yuan at peak. The peak figure can rise further if long fetched pages push input tokens up sharply. The difference does not come from a lower model price. It comes from the extra API request costs introduced by the integration approach.

    4. Architecture Selection and Cost Optimization Best Practices

    1. Match the approach to the scenario. For simple general knowledge Q&A and news retrieval, the built-in web search tool offers the best cost-performance ratio because it has no tool fee and needs minimal integration work. For complex RAG (retrieval-augmented generation) architectures that require precise control over search sources, multi-round retry logic, or integration with a private knowledge base, the external API approach offers more flexibility.

    2. Use token caching. Whichever approach you choose, controlling input tokens is key to reducing costs. Use the context caching feature of your model platform. For fixed prefixes such as system prompts, a cache hit typically costs only 2% to 5% of the uncached price. In multi-turn conversations, keep the context window under control and leave out unneeded historical messages.

    3. Schedule off-peak work. If the business does not need real-time responses, use a task queue to run large batches of offline Q&A tasks during off-peak hours. This roughly halves the model cost.

    4. Handle failures and retries. External API requests often hit network timeouts or page parsing failures. Your code needs thorough exception handling and fallback strategies. For pages that fail to fetch, skip them quickly or fall back to the search summary so that failed retries do not consume API quota.

    Conclusion

    Removing built-in tool call fees lowers the development barrier and initial cost for web-enabled applications. Costs do not disappear, however. They move to different billing dimensions. Engineers need to look past the appearance of “free” and account for every token in the architecture design, then choose the web search strategy that fits the business. Only by considering model fees, tool fees, and fetch fees on one bill can LLM applications reduce costs and improve efficiency.