From Pay-per-Call to Unified Token Pricing: How LLM Web Search Billing Has Evolved
This article explains how one large model platform changed the billing for its built-in web search and page fetching features, moving from per-request fees to unified token-based pricing. It covers why per-call billing creates cost problems for agent workflows, what the shift means for developers, and practical ways to control token usage, including content cleaning, caching, and better search strategies.
Large language models (LLMs) are increasingly used in applications that need current information. A model trained on past data cannot answer questions about recent events, so web search and page fetching have become basic infrastructure across major model platforms.
Recently, one large model platform announced a major change to how it bills for web search. From a specified date, the server-side search and page fetching triggered during model calls will no longer be billed separately. Instead, their cost will be included in the token usage of the model call itself. This move from per-call billing to unified token billing offers a new model for how AI services can be priced. It also affects how developers design their architectures and control costs.
1. Why Web Search Matters in RAG and Agent Architectures
Retrieval-augmented generation (RAG) and AI agents are two major approaches in modern LLM applications. RAG combines an external knowledge base with an LLM to improve answer accuracy. Agents give the model the ability to use tools. Web search and page fetching APIs are key bridges that let both approaches access real-time information on the internet.
A complete web search workflow usually includes two core actions:
- Search API: Searches the internet for a user query or a query generated by the model, then returns a structured list of results, including titles, snippets, and links.
- Fetch API: Retrieves the full content of a specific URL from the search results and converts it into Markdown text that the model can easily process.
In the past, some platforms offered these capabilities as standalone APIs billed per request. For example, one platform once tested a rate of 5 yuan per 1,000 successful requests. In practice, however, this billing model created several pain points.
2. Comparing Billing Models: Limits of Per-Call Billing and Benefits of Unified Token Pricing
1. Limits of Per-Call Billing
Under per-request billing, developers pay a fixed fee for every search or fetch call. This model is simple for basic queries, but it becomes hard to manage in complex agent applications:
- High call volume drives up costs: Agents often use the ReAct (Reasoning and Acting) framework. In this think-act loop, a model may run several searches and fetches to verify a single fact. Frequent tool calls can quickly inflate the bill and raise the cost barrier for running the application.
- Hard to predict and budget: Developers must track and estimate tool call counts separately from model inference token usage. In complex workflows, predicting the number of searches is difficult, so companies struggle to build accurate cost budgets.
- Integration friction: When web search tools are exposed through compatible interfaces or response-style APIs, the separation between client-side calls and server-side search makes billing harder to trace. This complicates debugging and reconciling invoices.
2. Advantages of Unified Token Billing
About 18 days after launching per-call billing, the platform removed it and switched to billing only by model token usage. This change offers clear technical and commercial benefits:
- No marginal cost for tool calls: Search and fetch become built-in capabilities of a model call instead of separate billable items. Developers no longer pay for the search action itself. They only pay for the tokens the model uses to process the search results.
- Lower barrier for high-frequency use: For agent applications that need frequent web access, the cost barrier drops significantly. Developers can let the model run more rounds of search and verification, which may improve answer quality and accuracy.
- Simpler billing: All costs are included in the model call. Developers only need to track input and output token counts. This flat billing structure reduces the mental overhead of managing costs, so developers can focus on improving their business logic.
3. Development Practices and Cost Control Under the New Architecture
Under the unified billing system, search calls are no longer billed separately. However, fetched web content is ultimately converted into text input for the model, which increases token consumption. As a result, the main optimization goal shifts from reducing the number of calls to optimizing token usage.
The following practices help developers build efficient RAG and agent applications under this new model.
1. Trim Fetched Content to Control Context Length
When a fetch API returns the main body of a web page in Markdown, the text often includes a lot of navigation bars, advertisements, footers, and other irrelevant content. Feeding this text into the model context as is wastes tokens and can distract the model.
Developers should build middleware that cleans and truncates the fetched Markdown. For example, they can use regular expressions or lightweight rule engines to remove leftover HTML tags and keep only the main article paragraphs. Alternatively, they can score paragraphs by importance and send only the top-K most relevant paragraphs to the model.
# Pseudocode example: cleaning and truncating fetched web contentdef clean_and_truncate_markdown(raw_markdown, max_tokens=2000):# 1. Remove common noise such as navigation text or boilerplatecleaned_text = remove_noise_patterns(raw_markdown)# 2. Split into paragraphs and score their importance (e.g., keyword matching)paragraphs = cleaned_text.split('\n\n')ranked_paragraphs = rank_paragraphs_by_relevance(paragraphs)# 3. Trim the result to fit within the preset token limitfinal_context = assemble_within_limit(ranked_paragraphs, max_tokens)return final_context
2. Add Caching to Avoid Repeated Token Usage
For frequently asked questions, developers can cache search results or fetched Markdown text for a short period using basic cloud services, such as object storage or distributed cache databases. When a user asks a similar question, the system can return the stored results directly. This avoids triggering another server-side search and re-reading long documents, which would otherwise consume tokens again. Caching matters most for reducing overall cloud costs in applications with high concurrency.
3. Improve Search Query Generation and Tool Selection
In agent architectures, the quality of the search queries the model generates determines how relevant the results are. Relevant results reduce the need for a second search. Developers can refine the system prompt to guide the model toward more precise search queries.
The system prompt should also clearly define when to use the search tool and when to use the fetch tool. For example, when the user needs a list of recent news, the application can call only the search API. When the search snippets already contain enough information to answer the question, the application should skip unnecessary page fetches. This helps control the growth of input tokens.
4. Conclusion
Removing separate billing for web search and fetching, and folding these features into unified token billing, marks a step toward more mature and simplified API services. This change lowers the development cost of high-frequency web-connected applications and reflects a growing focus on developer experience across the industry. For developers and companies, the key to staying competitive in the next wave of AI application development is to shift focus from controlling call volume to optimizing token context and building efficient caching architectures.
