Token Cost Estimation for Web-Connected Q&A: What "Free Search" Actually Means
This article breaks down how token-based billing works for web-connected Q&A after a cloud provider removed separate tool-call fees for server-side search and page fetching. It explains the difference between built-in web access and a self-built retrieval pipeline, walks through a single-task cost model with peak and off-peak pricing, shows how costs scale with usage, and lists practical optimization and architecture recommendations. Readers will learn why "free search" only eliminates the action fee while retrieved content still drives token costs, and how to build a realistic budget instead of relying on assumptions.
1. The Bottom Line First: The Action Fee Is Waived, Not the Inference Fee
A new type of billing adjustment has recently appeared in the industry: a cloud provider has exposed built-in model capabilities such as search, web page fetching, file parsing, and speech at the API layer, and announced that retrieval and fetching triggered by the server when you call the model will no longer incur a separate tool-call fee. Once this news spread, it was easy to read it as “web-connected Q&A is now free.” That is a typical misreading, and one of the easiest traps to fall into when budgeting costs.
The accurate statement is this: the “retrieval action” and “fetching action” performed on your behalf by the server are no longer billed, but the text these actions bring back participates in inference and is still charged per token. In other words, the bill has gone from two parts, “model fee + tool fee,” to a single part, the “model fee,” and the model fee itself has not become cheaper.
To understand this, you must distinguish between two integration methods, because their cost structures are completely different.
1. Built-in Web Access: The Model Decides Whether to Search
In this mode, you only describe the task, and the model decides on its own during inference whether to initiate a search, which link to open, and how much body text to read. Retrieval and fetching are done by the server, and the actions themselves are free; the cost is that the fetched content enters the context and becomes part of the billable input.
2. Self-Built Retrieval Pipeline: The Program Searches First, Then Feeds Material to the Model
In this mode, your program first calls a search API to get candidate results, then calls a fetching API to get the body text, cleans, truncates, and assembles it into a prompt, and finally hands it to the model to generate an answer. Search and fetching are usually billed per thousand successful requests; failed, timed-out, and no-result requests are generally not billed, and the model fee is settled separately.
The key insight is here: for the same web-connected Q&A task, the cost difference between the two approaches does not come from a model price cut, but from “who bears the retrieval cost” and “how many tokens are stuffed into the context.” A self-built pipeline seems to make the tool fee explicit, but if you reduce recall to save on tool fees and stuff large amounts of raw web pages into the context, the token fee will instead spiral out of control.
2. Single-Task Cost Model: Breaking Down 6,000 Input Tokens
Take a typical web-connected Q&A task as an example, assuming a single task accumulates 6,000 billable input tokens and 1,000 billable output tokens (including thinking-process usage), with no retries triggered and no other paid services used. The reason for emphasizing “accumulated” is that many people only count the single sentence of the user’s question, while the real billable input also includes: the system prompt, tool definitions and call parameters, retrieval results, web page body fragments, and the historical context of multi-turn follow-ups.
Using the industry-common tiered pricing approach (two tiers, peak and off-peak, in yuan per million tokens):
| Billing item | Off-peak | Peak |
|---|---|---|
| Input, cache miss | 1 | 2 |
| Input, cache hit | 0.02 | 0.04 |
| Output | 4 | 8 |
Peak usually refers to the concentrated usage periods during weekday daytime and afternoon, and the rest is off-peak. Based on this, 1,000 tasks are estimated as:
- Off-peak: 6 × 1 + 1 × 4 = 10 yuan
- Peak: 6 × 2 + 1 × 8 = 20 yuan
Spread across a single task, that is about 1 cent and 2 cents. Note that this is a set of budget assumptions, not measured data, and does not constitute any vendor’s commitment; the real bill depends on your prompt length, number of recalled items, body-text truncation strategy, and cache hit rate.
The illustrative estimation code can be written as a pure function, making it easy to plug into a budget dashboard:
def estimate_cost(tasks, in_tok, out_tok, peak, cache_hit=0.0,price=(1, 0.02, 4), peak_price=(2, 0.04, 8)):p_in, p_cache, p_out = peak_price if peak else priceeff_in = in_tok * (1 - cache_hit)cached = in_tok * cache_hitper_task = (eff_in * p_in + cached * p_cache + out_tok * p_out) / 1e6return per_task * tasks
3. Scaling Usage: Linear Extrapolation and Nonlinear Traps
A single-point estimate is not enough to support capacity planning; scaling linearly at the same unit price gives you a batch budget:
| Input per task | Output per task | Off-peak (1,000 tasks) | Peak (1,000 tasks) |
|---|---|---|---|
| 6,000 | 1,000 | 10 yuan | 20 yuan |
| 12,000 | 1,000 | 16 yuan | 32 yuan |
| 6,000 | 2,000 | 14 yuan | 28 yuan |
| 12,000 | 2,000 | 20 yuan | 40 yuan |
Linear extrapolation holds only when the unit price and usage structure stay unchanged. In reality, there are three types of nonlinear factors: first, the cache hit rate varies with prompt stability, and after a hit the input unit price can drop by one to two orders of magnitude; second, the tool fee of a self-built retrieval pipeline is proportional to request volume, and if 1,000 tasks each trigger 2 searches plus 3 fetches, the tool fee will quickly exceed the model fee; third, failed retries amplify both tool requests and token consumption at the same time.
4. Cost Optimization Checklist
- Compress the context: Apply extractive summarization and length truncation to web page body text, keeping only paragraphs relevant to the question.
- Stabilize the prompt prefix: Fix the system prompt and tool definitions at the front to improve the cache hit probability.
- Tiered routing: Send simple questions to a non-web-connected model, and enable retrieval only for complex questions, avoiding full-volume web access.
- Request deduplication and merging: Reuse results for identical queries within a short window to reduce repeated fetching.
- Observability first: Use logging services and monitoring alerts to record the input composition of each task, whether it actually went online, and the number of tool calls, before talking about optimization.
- Compare prices for self-built pipelines: When the tool fee of a self-built search-and-fetch setup approaches or exceeds the total cost of the built-in approach, re-evaluate the integration method.
5. Three Recommendations for Architecture Decisions
First, put “model fee + retrieval fee + fetching fee + failed-retry overhead” into the same bill for evaluation, rather than staring only at the unit price. Second, run a small-percentage canary with real traffic to measure the average input tokens and cache hit rate under your business, then replace the budget assumptions. Third, set budget guardrails and circuit-breaker thresholds for web-connected capabilities to avoid context expansion caused by abnormal prompts. Do these three things, and “free search” becomes real savings, rather than moving the cost somewhere invisible.
