How LLM Web Search and Fetch Billing Works: Token Costs vs. Per-Call Tool Fees

    This article breaks down a recent billing change in which LLM providers stop charging separately for model-triggered web search and page fetching, so users pay only for the tokens the model processes. It explains the two distinct call paths—built-in model tools billed by tokens and standalone tool endpoints billed per successful request—and why retrieved page content becomes input tokens that can multiply costs. You will find a cost breakdown of a typical web-grounded Q&A, a developer optimization checklist covering context compression, caching, retrieval budget guardrails, routing, observability, and rate limiting, plus a simplified budget formula and a final implementation checklist.

    1. The Bottom Line: Which Part Is Actually Free

    A recent round of billing changes works like this: when a model triggers web search and page fetching on its own while completing a task, the server no longer charges separately per call for the “search action” and the “fetch action.” Users pay only for the tokens generated while the model processes text.

    Two qualifiers in that sentence are easy to miss: “triggered by the model itself” and “the tool invocation itself.”

    In other words, what has been waived is the per-call fee on the tool side, not the fee on the model inference side. The retrieved page content is concatenated into the context and billed as input tokens; the answer the model generates is billed as output tokens. Reading “search is free” as “the bill is zero” is the most common misinterpretation right now.

    There is also a separate path to distinguish. If you write your own program that bypasses the model and calls the platform’s exposed search and fetch interfaces directly (usually standalone tool endpoints in a REST style), those calls are generally still billed per successful request—for example, a standard price of a few yuan per thousand successful requests. This rule did not change in the current adjustment.

    So the first step in figuring out whether your bill will shrink is not to look at the price list, but to look at which path your toolchain takes.

    2. Two Call Paths, Two Cost Structures

    Placed side by side, the difference between the two modes is clear:

    • Built-in model tool path: the model autonomously decides when to search, what to search, and which page to fetch during inference. The billing dimension is tokens (input + output); tool actions are not billed separately.
    • Standalone tool endpoint path: your code explicitly issues search or fetch requests and assembles the structured results itself. The billing dimension is the number of requests, independent of tokens.

    The pseudocode below is illustrative only. It shows the control-flow difference between the two paths and does not point to any specific API:

    1. # Path A: built-in model tools (token billing)
    2. resp = chat(
    3. model="...",
    4. messages=[{"role": "user", "content": "Look up the latest industry data and summarize it"}],
    5. tools=["web_search", "web_fetch"] # the model decides when to call them
    6. )
    7. # Bill: input tokens (including fetched page content) + output tokens
    8. # Path B: standalone tool endpoints (per-call billing)
    9. pages = tool_search(query="latest industry data") # each successful request counts
    10. text = tool_fetch(url=pages[0].url) # each successful request counts
    11. resp = chat(messages=[{"role": "user", "content": summarize(text)}])
    12. # Bill: search calls + fetch calls + model tokens

    Three key implications follow. First, Path A folds “tool cost” into “context cost,” so cost grows linearly with the length of the fetched content; Path B’s cost grows with the number of calls and is only weakly related to text length. Second, the number of calls in Path A cannot be predicted precisely and must be constrained with prompts and budget guardrails; Path B is fully controllable and suits batch processing and high-frequency fixed queries. Third, the two paths are not mutually exclusive—mature solutions often mix controlled explicit fetching with built-in model search.

    3. Tokens Are the Real Driver: Cost Breakdown of a Web-Grounded Q&A

    A typical web-grounded Q&A has four parts on the input side: the system prompt, the conversation history, the retrieval results (multiple page bodies), and the user’s current question. The output side is the answer the model generates. What usually drives the bill up is the retrieval results section.

    Consider an order-of-magnitude example (illustrative, not a real quote): if one search returns 5 results with about 3,000 characters of body text each, the input is roughly tens of thousands of tokens; if the model triggers 3 searches in one task, input tokens stack up to the tens of thousands. What the tool fee waiver saves is the small per-call charge, while token spending may end up several times higher than before.

    So the correct cost intuition is: tools free → the model is more willing to search more → the context grows → tokens rise. This is not a pricing trap but a shift in the billing dimension. When budgeting, treat the “number of searches” as a multiplier on tokens, not as an independent line item.

    4. A Cost Optimization Checklist for Developers

    1) Context compression. Apply extractive summarization or paragraph filtering to fetched content first, keeping only the fragments relevant to the question before adding them to the context. This step usually delivers the most significant token reduction.
    2) Caching and reuse. Build a result cache for high-frequency queries (keyed by the normalized query string plus a time window), and use object storage to keep the original fetched content, avoiding repeated searches and repeated billing.
    3) Retrieval budget guardrails. State explicitly in the prompt “search at most N times, keep at most M passages each time,” and enforce a hard block at the application layer to prevent the model from falling into a repeated-search loop.
    4) Tiered routing. Send fixed factual questions to explicit tool endpoints and a self-built index; send open-ended, exploratory questions to built-in model search. Routing puts controllability and flexibility where they belong.
    5) Observability. Use a logging service to record the number of searches, context tokens, and output tokens per task, and set a per-task cost threshold with monitoring alerts that automatically degrade to a “no web, local knowledge only” mode when something goes wrong.
    6) Rate limiting and queues. On the container platform side, apply concurrency and rate limits to high-consumption tasks and use a message queue to smooth peaks, so a few long sessions do not drag down the overall experience.

    A simplified budget estimate can be written as:

    1. cost per task ≈ (system prompt + history + retrieved text + question) × input unit price
    2. + output length × output unit price
    3. + explicit tool calls × per-call tool price
    4. where: retrieved text ≈ number of searches × passages kept per search × passage length

    Focus on the product of “number of searches × passage length,” and optimization has a clear target.

    5. The Platform Governance View: Rebalancing Limits and Experience

    This kind of billing change often happens alongside something else: usage limits on free tiers, such as caps on conversation frequency or context length on web and mobile clients. The shared logic is to free scarce inference compute from “very long context, low-frequency, high-consumption” usage and redirect it to regular Q&A and developer calls.

    From an engineering governance perspective, this is reasonable capacity management: a small number of very long sessions occupy GPU memory and scheduling resources for extended periods, pushing up overall latency and triggering service instability. Limits, caching, context window trimming, and request priority queues are all tools in the same box. For teams that depend on an API in production, the environment becomes more stable and predictable.

    As for the argument over whether this “betrays users,” it is essentially a resource allocation question between free tiers and paid experience. A more practical stance for developers is to get the cost model right and build an architecture that can degrade, be rate-limited, and be observed—then any change in billing rules will not turn into an incident.

    6. Implementation Checklist

    • Determine whether your retrieval uses built-in model tools or explicit endpoints; the two have different billing dimensions.
    • Set a cap on the number of searches and the context length for each task.
    • Summarize or chunk fetched content before adding it to the context.
    • Build a result cache and archive the original content.
    • Use logs and monitoring to account for per-task token cost, and set alert thresholds.
    • Design a degradation path: automatically turn off web access and switch to local knowledge when the budget is exceeded.
    • Use general-purpose capabilities such as Baidu AI Cloud’s object storage, logging service, monitoring alerts, container platform, and message queue to support the engineering pieces above.

    In one sentence: this adjustment stops charging separately for the “search action” but pushes the cost focus even more firmly onto context and tokens. Understanding the shift in the billing dimension matters more than watching the unit price.