LLM Web Search Billing Switches to Pure Token-Based Pricing

    This article examines a cloud provider's shift from per-request billing to pure token-based pricing for server-side web search and page fetching triggered inside LLM calls. It explains the key distinction between built-in model web access and standalone retrieval APIs, rebuilds the cost model around input and output tokens, and outlines practical optimization levers: context engineering, snippet reranking and summarization, layered caching, bounded retry logic, observability, and architecture selection. Developers will learn why retrieval frequency no longer controls cost and how context quality becomes the main driver of both accuracy and spend.

    1. What Happened: A Billing Policy That Lasted Only 18 Days

    A cloud provider’s LLM platform recently announced on its official site that, starting at 12:00 noon on a given day, web search and page fetching automatically triggered by the server during model calls would no longer be billed separately. Users would pay only for model token usage.

    Before that, the “pay per request” rule had only just gone live. In mid-October, alongside a model version update, the platform opened retrieval and fetching capabilities built on its in-house search engine. Both interfaces were priced at 5 RMB per 1,000 successful requests, and developers were given a transition period of roughly two weeks. During that window, server-side tool calls in intelligent coding tools were not billed; per-request settlement officially began at 00:00 on November 1.

    Straightened out, the timeline looks like this: capabilities and pricing announced in mid-October, billing starting in early November, per-request billing canceled in mid-November. In other words, per-request billing for model-side web access ran for only 18 days before the cost was folded entirely into the token billing system.

    One distinction matters a great deal: this change applies only to search and fetching automatically triggered inside the model call chain. Standalone retrieval and fetching APIs are unaffected and remain priced at 5 RMB per 1,000 successful requests. That distinction determines how developers choose their architecture and estimate costs.

    2. Why “Built-in Model Web Access” and “Standalone Retrieval APIs” Are Different

    Many developers conflate the two paths when reading the announcement, but they are completely different in engineering terms.

    • Built-in model web access: the model server decides on its own whether to retrieve during inference, and the results are injected as context. It is a black box to the caller. You cannot precisely control how many retrievals happen or which pages are fetched; you only observe the final token consumption.
    • Standalone retrieval API: invoked explicitly by your business code, returning structured results. It is controllable, cacheable, and auditable. It suits building your own knowledge base, performing precise recall, and running offline evaluation.

    The billing difference has a direct consequence: the marginal cost of built-in web access shifts from “number of calls × unit price” to “context length × token price.” Cost drivers migrate from retrieval frequency to context volume and output length.

    3. Rebuilding the Cost Model: From Per-Request to Per-Token

    Under per-request billing, cost was roughly:

    1. Cost ≈ N_search × price_per_1k + Tokens × price_per_token

    Under pure token billing:

    1. Cost ≈ (Tokens_in + Tokens_out) × price_per_token

    Tokens_in expands significantly because retrieved content is injected. In a typical web-augmented Q&A, the injected page text alone often occupies several thousand tokens. So “retrieve less” no longer means “spend less”; “the retrieved content is too long” is the new cost amplifier.

    An illustrative budget estimation:

    1. def estimate_cost(avg_in_tokens, avg_out_tokens,
    2. in_price, out_price, qps, seconds):
    3. per_call = avg_in_tokens * in_price + avg_out_tokens * out_price
    4. return per_call * qps * seconds
    5. # For web-enabled calls, avg_in_tokens typically includes:
    6. # system prompt + conversation history + retrieved snippets + user question

    Practical advice: set a separate max_in_tokens budget threshold for web-enabled requests, and trigger snippet trimming or summary compression when the threshold is exceeded, so a single request’s context does not spiral out of control.

    4. Context Engineering: Treat Injected Content as a First-Class Citizen

    Under pure token billing, the core optimization point for retrieval-augmented generation moves from “number of retrievals” to “context signal-to-noise ratio.” Actionable techniques include:

    1. Snippet reranking and truncation: sort by relevance first, then greedily fill according to the token budget, discarding low-relevance snippets outright.
    2. Layered summarization: apply extractive summarization to long pages before injection, which typically compresses context volume by more than 60%.
    3. Deduplication and near-duplicate merging: merge multiple pages on the same topic into one passage to cut redundant phrasing.
    4. Structure first: organize retrieval results as bullet-point lists rather than raw paragraphs to lower token density.
    5. Conversation history compression: apply rolling summaries to earlier turns in multi-turn web sessions.

    Illustrative pseudocode:

    1. def build_context(query, docs, token_budget):
    2. ranked = rerank(query, docs)
    3. picked, used = [], 0
    4. for d in ranked:
    5. snippet = summarize(d) if len(d) > 800 else d
    6. cost = count_tokens(snippet)
    7. if used + cost > token_budget:
    8. break
    9. picked.append(snippet)
    10. used += cost
    11. return "\n\n".join(picked)

    5. Caching: The Biggest Cost Lever in Web-Enabled Scenarios

    Retrieval results are highly time-sensitive but weakly unique, which dictates a layered cache design:

    • Semantic cache: reuse historical answers for similar questions; hit rates are meaningful in high-frequency FAQ scenarios.
    • Retrieval result cache: cache page text keyed by “query + time window,” with TTL set according to business freshness requirements.
    • Summary cache: cache compressed snippets to avoid repeated summarization overhead.
    • Prefix cache: place stable system prompts and tool descriptions at the very front of the context to leverage inference-side caching and reduce repeated billing.

    Note that cache keys must include a freshness dimension; otherwise stale information is returned, causing factual errors.

    6. Retries and Observability

    In the per-request era, failed requests were not billed, so the psychological cost of retrying was low. Under token billing, tokens are already consumed once a request enters inference. Retry strategies must therefore converge:

    • Use exponential backoff with a maximum retry count to avoid avalanche-style repeated consumption.
    • Distinguish retryable errors (rate limiting, timeouts) from non-retryable ones (invalid parameters, content policy blocks).
    • Build a usage dashboard measured in tokens, attributed by business line, interface, and tenant.
    • Configure budget alerts: notify when cumulative daily tokens exceed a threshold, rather than waiting for the bill.
    1. for attempt in range(MAX_RETRY):
    2. try:
    3. return call_model(payload)
    4. except RetryableError:
    5. sleep(backoff(attempt))
    6. except FatalError:
    7. break

    7. Architecture Selection

    • Need precise recall, auditability, and offline evaluation: use the standalone retrieval API and manage caching and ranking yourself.
    • Need low integration cost and a fast path to general web Q&A: use the model’s built-in web access, focusing on context budget control.
    • Hybrid mode: use the standalone retrieval API for coarse filtering, then hand a small number of high-value snippets to built-in web access for supplementation, balancing cost and quality.

    It is also advisable to connect model calls, retrieval calls, and cache hit rates into a unified logging service and alerting system to close the loop.

    8. What This Means for Developers

    With per-request billing removed, the cost structure of web-enabled calls becomes single-dimensional: one request, one token count. The benefits are better budget predictability, fewer billing disputes, and lower prototype validation costs. The tradeoff is that developers lose the natural brake of “retrieve less, spend less” and must take active ownership of context governance. The one-line engineering summary: the billing basis changed, and the optimization focus shifts from call volume to context quality.

    On the vendor side, the in-house search engine is described as covering hundreds of billions of web pages globally, supporting multiple languages, processing hundreds of millions of requests per day, and identifying and filtering SEO manipulation, content manipulation, and low-quality generated content. This underlying capability sets the quality ceiling for injected content and is the precondition for pure token billing to work. For developers, the most reliable cost-reduction path under this model is to invest in snippet filtering, summary compression, and cache reuse.