API Web Search Goes Free, but Token Fees Are Still the Biggest Cost
A major LLM platform recently removed per-call fees for server-side web search and page fetching, but this only applies to one part of the bill. This article breaks down the difference between tool-call fees and model inference fees, compares the cost models of model-triggered search versus manually calling search APIs, explains why search acts as a "token consumption amplifier," and offers practical optimization strategies—context trimming, result caching, and token budgeting—for different workloads.
Starting from “Free Search”: A Cost Misreading Triggered by a Pricing Change
Recently, a major LLM platform announced a significant pricing adjustment for its web search capability: starting from a specific date, search and web page fetching actions triggered by the model on the server side would no longer incur separate tool-call fees. Many developers assumed their entire bill would drop to zero, but the reality is far more nuanced. To truly understand how this change affects your business costs, you first need to distinguish between two fundamentally different billing dimensions in AI service calls: tool fees and model inference fees.
1. The Essence of the Pricing Change: Tool-Call Fees vs. Model Inference Fees
1.1 The Cost Structure of a Complete AI Service Call
When a developer uses an API to have an LLM complete a “search the web and answer” task, two distinct computation stages actually happen in the backend:
- Tool execution stage: The model initiates a search command, and a server-side search component retrieves internet content, then fetches the body text of relevant pages. This stage consumes the search service’s compute and bandwidth resources, and was previously billed separately per successful request.
- Model inference stage: The retrieved web content is concatenated into the context window, and the model must read, comprehend, and synthesize this “new material” to generate the final answer. This stage consumes the LLM’s compute resources and is billed by token count.
1.2 What Exactly Changed
The core of this pricing adjustment is: when the model autonomously decides to trigger a search, the per-call billing for the first stage (tool execution) is removed. In other words, the search and fetching actions themselves no longer incur an extra per-call charge.
However, the model inference fees in the second stage have not been removed. The web content returned by search enters the context as tokens, and those tokens still need to be processed by the model. This cost is still calculated at standard token rates—including input tokens (the retrieved web content) and output tokens (the model’s generated answer).
1.3 Two Easily Confused Invocation Patterns
To understand the real scope of this pricing change, you must distinguish between two very different development paths:
Path 1: Model-triggered search
This is the “managed” invocation pattern. Developers simply enable a web search option in the request parameters (similar to managed search offerings common in the market, or the web_search tool in the Responses API), and the model automatically decides when to search and what to search for. Under this pattern, the pricing change applies—the per-call fees for search and fetching are removed.
Path 2: Manually calling search/fetch APIs
This is the “self-managed” pattern. Developers explicitly call the underlying search service API or web fetching API, obtain page content themselves, and then splice it into subsequent model requests. Under this pattern, the billing rules have not changed at all—you are still charged per successful request, typically a few units of currency per thousand requests.
2. Rebuilding the Cost Model: The Ledger Logic Under Different Paths
2.1 Cost Formula for Path 1 (Model-Triggered Search)
With the “model decides when to search” pattern, the cost of a single request can be expressed as:
Total cost = input tokens × unit price + output tokens × unit price
Here, input tokens include not only the user’s question but also the web content the model retrieved and appended. Suppose the search returns 3 pages that add roughly 4,000 tokens of context—at the platform’s input token rate, that is a real incremental cost.
2.2 Cost Formula for Path 2 (Manually Calling Search APIs)
With the “manually call the search API” pattern, the cost of a single request splits into two parts:
Total cost = number of search API requests × per-call price + model request tokens × unit price
In this pattern, even if the model ultimately doesn’t consume the retrieved content, the developer pays for every search API call. This pattern is therefore better suited to scenarios requiring precise control over search behavior—for example, low search frequency where every result is fully utilized.
2.3 Cost Comparison of the Two Patterns
Take a typical “deep research” task, which usually involves multiple rounds of search and extensive page reading:
| Cost Component | Model-Triggered Search | Manual Search API Calls |
|---|---|---|
| Search/fetching fees | $0 | Billed per call |
| Token cost of retrieved content | Counted as input tokens, billed | Counted as input tokens, billed |
| Model output token fees | Billed normally | Billed normally |
This means that for high-frequency search and deep-reading use cases, the adjusted “model-triggered search” pattern can save a meaningful amount in tool-call fees. But for scenarios with extremely heavy token consumption, the tool-fee savings may be a drop in the bucket compared to token costs.
3. The Real Cost Driver: Token Growth Caused by Search
3.1 How Search Inflates Token Usage
This is a point many developers overlook: search is a “token consumption amplifier.” A single search request may return 3–5 page summaries, each roughly 500–1,500 tokens. Take a medium-sized search task as an example:
- User question: ~200 tokens
- Retrieved web content (5 pages, averaging 800 tokens each): ~4,000 tokens
- Model-generated answer: ~500 tokens
Total input is about 4,200 tokens, of which roughly 95% comes from the retrieved web content. In other words, the “material” the model reads is often more than 20 times the size of the user’s question.
3.2 The Cost Amplification Effect in Long-Context Scenarios
In complex tasks requiring multiple consecutive rounds of search (such as research report writing, competitive analysis, or market research), token consumption grows in steps. Each round of search injects new web content into the context, and all content in the context window participates in computation in every subsequent inference round. This leads to:
- Context accumulation effect: After multiple search rounds, the web content in the context may reach tens or even hundreds of thousands of tokens, all of which are recomputed in every subsequent inference round.
- The hidden cost of output tokens: When the model synthesizes large volumes of retrieved content, its output tends to be longer than in ordinary Q&A, pushing up output token fees.
3.3 Cost Estimation: A Concrete Example
Suppose a developer builds an automated research report generator. Each task triggers 3 searches, each returning about 5,000 tokens of web content, and the model ultimately outputs a 2,000-token report. Using typical token pricing (input at tens of currency units per million tokens, output at several times the input rate):
- Search tool fees (old model): 3 calls × per-call price = now saved entirely
- Input token fees (3 searches totaling ~15,000 tokens plus system prompt, etc.): roughly 0.5–2 currency units per task
- Output token fees (2,000 tokens): roughly 0.5–5 currency units per task
Even though per-call search tool fees have been removed, token-related fees remain the overwhelming majority of the bill—the two together usually amount to several currency units, while the saved tool fees might be only a few cents.
4. Strategies for Developers: How to Optimize API Costs
4.1 Scenario 1: High-Frequency Search, Low Token Density (Big Savings)
Applicable scenarios: Conversational retrieval, knowledge Q&A, e-commerce price comparison, etc. These tasks involve many searches, but each returns relatively compact content, with per-task token consumption in the low thousands.
Recommendations: Prefer the “model-triggered search” pattern and directly benefit from the tool-fee waiver. You can also cap the number of returned results and trim summary lengths to further control token consumption.
4.2 Scenario 2: Low-Frequency Search, High Token Density (Small Savings)
Applicable scenarios: Deep translation, long-document analysis, academic paper reading, etc. These tasks search infrequently but consume very high token counts per run.
Recommendations: In these scenarios, the tool-fee waiver brings negligible savings. The core optimization should focus on reducing token usage:
- Preprocess retrieved web content and extract only the key body paragraphs;
- Use a summarization model to compress web content before injecting it into the context;
- Carefully control context window accumulation to avoid token explosion from multi-round search.
4.3 Scenario 3: Fine-Grained Control Tasks (Per-Call Billing Still Matters)
Applicable scenarios: Programmatic batch queries, scheduled fetching, retrieval steps inside data pipelines.
Recommendations: These scenarios require precise control over the timing and frequency of retrieval, so keeping the “manual search API” pattern is advisable. Developers should:
- Design efficient caching mechanisms to avoid repeated searches for identical queries;
- Plan search batches sensibly to reduce wasted requests;
- Store retrieved content in structured form so it can be reused across multiple model calls.
5. Architecture-Level Cost Control Practices
5.1 Context Trimming Strategy
Before search content enters the context, developers can filter and compress it in code:
def process_search_results(raw_html_list, max_tokens_per_doc=800):"""Clean and truncate raw web page content returned by search,controlling how many tokens each document contributes to the context."""processed = []for html in raw_html_list:# 1. Strip HTML tags and script codetext = strip_html_tags(html)# 2. Extract core paragraphs (remove navigation, ads, and other noise)main_content = extract_main_content(text)# 3. Truncate according to the token budgettruncated = truncate_by_tokens(main_content, max_tokens_per_doc)processed.append(truncated)return processed
This preprocessing layer effectively reduces the total tokens that search content injects into the context, significantly lowering inference costs without sacrificing answer quality.
5.2 Caching and Reusing Retrieval Results
For scenarios with highly repetitive queries, introduce Redis or another caching layer to store search results:
# Pseudocode: search result caching flowdef cached_search(query, cache_client):cache_key = f"search:{hash(query)}"if cache_client.exists(cache_key):return cache_client.get(cache_key)results = search_engine.search(query)# Cache for 24 hours to avoid repeated searches for the same querycache_client.setex(cache_key, 86400, results)return results
For repeated queries, reading results directly from the cache saves both search fees and the downstream token processing costs.
5.3 Token Budget Planning for Multi-Channel Retrieval
In RAG-style applications that combine multiple retrieval channels (such as vector search, keyword search, and knowledge graph retrieval), set explicit token budget caps for each channel. For example:
- Vector search Top-5 documents: no more than 500 tokens each
- Keyword search Top-3 pages: no more than 800 tokens each
- Knowledge graph triples: no more than 1,000 tokens in total
With an overall budget constraint, you ensure the total token injection across the retrieval pipeline stays within a controllable range, preventing cost overruns caused by excessive retrieval results.
6. Conclusion: Read the Ledger, Decide Rationally
“Free search” is a conditional piece of good news. It only waives the per-call fees for search and fetching actions under the “model-triggered search” pattern, while token processing fees for the retrieved content are still charged in full. For developers, correctly understanding the billing differences between the two invocation paths and choosing the most suitable pattern for each business scenario is the key to controlling API costs.
Technical decisions are never simple black-and-white choices. After this pricing adjustment, most conventional “web-connected Q&A” applications can save money directly through model-triggered search. But for high-frequency, high-volume search-intensive workloads, you still need to be meticulous at the token level to make every cent count. Understanding the cost structure, building estimation mechanisms, and designing optimization strategies—that is the long-term path to sustainable API usage.
