Web Search Billed as Tokens: How to Calculate Costs After the Change
Server-side web search and page fetching are now billed as tokens instead of per-call fees. This article explains what changed, how to verify the billing dimensions that affect your cost model, and how to adjust your application architecture, monitoring, and caching strategy to keep token usage under control.
When a platform folds server-side search and web fetching into token-based billing, developers no longer need to track usage counts—cost comes down to a single variable. But search results and fetched page content become input tokens, which means token consumption can grow faster than before and deserves close monitoring.
1. Background: Why the Billing Model Changed
LLM APIs were originally billed purely on tokens—input and output text volume. As AI agents became mainstream, models needed real-time information, and web search and page fetching became standard capabilities. These tools invoke search engines and crawling services whose costs sit outside the token dimension, so some platforms experimented with per-call pricing.
Previously, the platform offered standalone Search and Fetch APIs, released alongside its newer models, and charged for them per call. This hybrid billing (token fees plus per-search fees) created real management overhead in practice: developers had to track two separate ledgers, while the model itself decided whether and how often to search—making call counts hard to predict.
This adjustment introduces two core changes:
- Searches and page fetches triggered automatically by the server during model inference—including tools following common standards such as
web_search—are no longer billed separately. They are now counted as token usage. - The standalone Search and Fetch APIs that developers call directly remain billed per call under the original terms.
This split makes sense. Standalone APIs are retrieval services developers deliberately invoke, so per-call pricing is intuitive. Server-side tools are invoked at the model’s discretion during reasoning, so treating them as part of the model’s capability and settling them in tokens is more natural.
Note: the original material did not include a link to an official announcement, so this article does not cite specific prices, dates, or eligible models. Refer to the platform’s official announcements and billing documentation for those details.
2. Cost Accounting: Clarify the Metering Rules First
Token-based billing doesn’t mean costs no longer need accounting. Before budgeting, developers should confirm the following:
| Metering Item | Questions to Verify |
|---|---|
| Whether search results count as input tokens | Are search snippets or page content spliced into the context and billed as input? |
| Page content length limits | How many characters or tokens are retained per fetched page, and is excess content truncated? |
| Whether failed requests are billed | Are timeouts, failed fetches, or empty results charged? |
| Whether retries are billed multiple times | Do application-level or model-internal retries generate extra tokens? |
| How the two API types differ in billing | Are the rules identical when the same search capability is invoked via the standalone API versus a server-side tool? |
The answers define your cost model. If search results are billed as input tokens, fetching full pages can significantly inflate costs. If failed requests are billed, monitoring reports should separate successful and failed requests.
The following pseudocode illustrates the application-layer difference before and after the change:
# Before: track both search counts and token consumption (pseudocode)def call_model_with_search(prompt):if search_quota_available():response = llm_api.call(prompt, tools=["web_search"])log_search_cost(response.search_count) # per-call feelog_token_cost(response.token_usage) # token feeelse:response = llm_api.call(prompt) # disable web search, fall back to text-onlyreturn response# After: track token consumption only (pseudocode)def call_model_with_search_simplified(prompt):response = llm_api.call(prompt, tools=["web_search"])log_token_cost(response.token_usage)return response
Before running this, verify a few things. The exact syntax of the tools parameter in llm_api.call depends on your SDK’s documentation. Whether fields like search_count and token_usage exist depends on the API’s response structure. Replace the logging functions with your project’s existing logging solution. Note that the simplified version removes quota checks, so it must be paired with token limits—otherwise token usage can spiral.
3. Impact on Application Architecture
Three architectural changes:
- Per-call business logic can be removed. Quota checks and circuit breakers built to control per-call fees can be dropped under the new billing model, reducing maintenance burden.
- Replace call-count limits with token limits. The cost boundary shifts from search counts to tokens. Set a maximum input token count and a timeout at the request layer, plus a maximum tool-calling round count if the API supports it.
- Logging needs to get finer-grained. Log input tokens, output tokens, tool invocations, and failure reasons per request, so you can pinpoint which features drive abnormal token consumption.
4. Search Quality and Token Consumption
Search quality directly affects token costs. If the search engine returns many duplicate or low-quality pages, the model ingests that useless content, producing wasted input tokens.
According to the platform, its search engine identifies and filters SEO spam, Generative Engine Optimization (GEO) manipulation, and low-quality AIGC content. GEO here refers to Generative Engine Optimization—optimization and manipulation by content producers trying to get generative AI search engines to cite their content more often. GEO filtering and low-quality AIGC filtering target different problems: the former addresses ranking manipulation, the latter the quality of the content itself. Both help reduce useless context. Whether the filtering meets your business needs should be validated with real query samples.
5. Best Practices
- Optimize prompts, not just call counts. Tell the model explicitly what information it needs and how many sources to consult, so it doesn’t search repeatedly for a simple question.
- Limit output length. Ask the model for structured, concise answers to reduce output tokens.
- Cache high-frequency queries. For repeated or similar questions, cache retrieval results and generated content to avoid duplicate searching and inference. Caches must have expiration times, since web content changes.
- Preprocess fetched content. If you fetch pages yourself, strip navigation bars, ads, and irrelevant sections before feeding them to the model.
- Set up token monitoring and alerts. Track token usage daily and per feature module, set thresholds, and trigger alerts when limits are exceeded. This can be built on your existing logging and metrics infrastructure.
6. Common Mistakes
- Removing all constraints after per-call billing ends. Search counts no longer incur separate fees, but tokens still accumulate. Keep a per-request token cap.
- Stuffing full page content into context. Long pages consume large amounts of input tokens; extract only the relevant sections.
- Caching without expiration policies. Stale caches keep serving outdated answers after pages update, forcing expensive re-retrieval later.
- Ignoring failures and retries. Timeouts and retries can generate extra consumption; track them separately in your logs.
- Confusing the two API types. Applying the standalone Search and Fetch billing rules to server-side tools, or vice versa, will skew your budget.
7. Conclusion
Unified token billing makes the cost structure easier to understand, but token usage will grow as search results flow into context. Verify the metering rules first, then set token limits and monitoring alerts. For specific pricing and effective dates, refer to the official documentation.
