Why Free Web Search in LLM APIs Is Technically Possible

    This article explains the technical logic behind making web search and page fetching free in large model APIs. It breaks down a typical retrieval-augmented generation pipeline, analyzes why the retrieval side has low marginal cost, and outlines a four-layer engineering design covering gateway quotas, multi-level caching, compliant fetching, and context budgeting. It also covers reliability and cost governance, common misconceptions, and practical recommendations for building sustainable retrieval-augmented applications under high concurrency and low cost.

    1. What “Free” Reveals About Capability Boundaries

    When a message appears saying that web search and page fetching in an API are now free, developers most easily misread it as a simple price adjustment. From an engineering perspective, removing retrieval and page fetching from the billing items means these two capabilities have shifted from “value-added features” back to “baseline pipeline components.” To understand the value of this change, first break down what actually happens during a large model call with web capability.

    A typical retrieval-augmented generation (RAG over Web) pipeline has six stages: query understanding and rewriting, retrieval recall, result ranking and deduplication, body extraction and cleaning, context assembly and truncation, and model generation with citation alignment. The stage that truly consumes compute is the final generation stage, while retrieval and fetching mainly consume bandwidth, crawl scheduling resources, and parsing compute. Making the latter free essentially pushes the cost center back onto model inference, while using engineering means to drive the unit cost of the retrieval side low enough.

    2. Cost Structure Breakdown: Why the Retrieval Side Can Be Given Away

    To judge whether a capability can stay free in the long run, you must look at its marginal cost curve.

    • Fetching has a very high repetition rate. Hot sites, authoritative documentation, and news sources are hit by large numbers of requests within the same time window, which naturally suits tiered caching.
    • Parsing results are reusable. Body extraction results, structured summaries, and timestamp fingerprints of the same page can be reused repeatedly within a validity period.
    • Retrieval recall is idempotent. The same query returns consistent results under the same index snapshot, which makes caching and precomputation easy.
    • The generation side is the elastic cost body. The longer the context and the higher the concurrency, the more significant the inference overhead.

    So the common practice in the industry is to make the cacheable, reusable, and precomputable parts free or low-cost capabilities, and to treat elastic inference as the main billing surface. This is not charity but a pricing strategy determined by cost structure. When evaluating “free,” what developers really need to focus on is the rate-limiting thresholds, cache hit rate, and data freshness commitments, rather than the price itself.

    3. Engineering Implementation: A Four-Layer Design for a Stable Retrieval Pipeline

    3.1 Access Layer: Unified Gateway and Quota Isolation

    Retrieval-type interfaces are the easiest to abuse, so identity recognition, quota allocation, and priority isolation must be done at the gateway layer. An illustrative policy configuration is shown below:

    1. quota:
    2. free_tier:
    3. qps: 5
    4. daily_calls: 2000
    5. cache_first: true
    6. paid_tier:
    7. qps: 50
    8. burst: 100
    9. priority: high
    10. routing:
    11. - match: "cache_hit == true"
    12. upstream: local_cache
    13. - match: "freshness <= 300s"
    14. upstream: edge_index
    15. - default: full_fetch

    The key point is that a free tier does not mean unlimited use. Quotas and priorities must be declared explicitly to avoid batch jobs crowding out interactive requests.

    3.2 Cache Layer: Multi-Level Hits and Invalidation Strategy

    A three-tier structure of “edge cache + regional cache + origin fetch” is recommended, with differentiated survival times set for each content type: short for news, long for documentation, and extremely short for transactional content. The cache key design should include the query, language, region, and time window to avoid cross-semantic contamination.

    3.3 Fetching Layer: Compliance, Throttling, and Deduplication

    Fetching must follow site protocols and access frequency constraints, and use fingerprint deduplication (body hash + normalized URL) to avoid repeated parsing. Failed requests should use exponential backoff retries, and a circuit-breaker threshold should be set to prevent a single-site failure from spreading into a global avalanche.

    3.4 Generation Layer: Context Budget and Traceable Citations

    Retrieval results need budget control before entering the context. A practical allocation ratio is: system instructions 10%, retrieval evidence 60%, conversation history 20%, and output reserve 10%. At the same time, keep the source identifier of each piece of evidence to make citation alignment and fact verification after generation easier.

    1. def build_context(query, evidence, history, budget=8000):
    2. reserve = int(budget * 0.1)
    3. ev_budget = int(budget * 0.6)
    4. hist_budget = budget - reserve - ev_budget
    5. picked, used = [], 0
    6. for item in sorted(evidence, key=lambda x: x.score, reverse=True):
    7. if used + item.tokens > ev_budget:
    8. continue
    9. picked.append(item)
    10. used += item.tokens
    11. return {
    12. "instruction": SYSTEM_PROMPT,
    13. "evidence": [e.render() for e in picked],
    14. "history": truncate(history, hist_budget),
    15. "max_output": reserve,
    16. }

    4. Reliability and Cost Governance: Running “Free” as a Sustainable Service

    Free capabilities fear two things most: being abused and being unstable. Governance measures include tenant-level token bucket rate limiting, abnormal traffic identification, sampled evaluation of result quality, and full-pipeline observability. For the observability part, it is recommended to cover three types of metrics: hit rate, origin fetch rate, and end-to-end latency percentiles. If you use Baidu AI Cloud, you can combine log services, monitoring and alerting, message queues, and object storage to complete collection, buffering, and archiving, forming a closed loop.

    For capacity planning, it is recommended to estimate bandwidth and storage by “peak QPS × average evidence size × cache hit rate discount,” and reserve 30% headroom to handle sudden hot spots.

    5. Common Misconceptions and Practical Recommendations

    • Misconception one: free means no cost. The real cost is shifted to rate-limiting experience and freshness.
    • Misconception two: more retrieval is always better. Evidence noise can significantly degrade generation quality, so relevance threshold filtering is needed.
    • Misconception three: ignoring compliance. Fetch scope, content copyright, and site protocols must be confirmed at the design stage.
    • Recommendation: first validate hit rate and quality with small traffic, then gradually open up quotas; keep cache hit rate as the core optimization metric and iterate on it continuously.

    6. Conclusion

    Making web search and page fetching free marks these capabilities becoming standard infrastructure for large model applications. For developers, the real competitive edge lies not in whether they use the free tier, but in whether they can make caching, rate limiting, evidence budgeting, and observability solid, so as to stably deliver trustworthy retrieval-augmented applications under the dual constraints of high concurrency and low cost.