LLM API Pricing Breakdown: Why "Free Search" Rarely Lowers Your Bill

    This article breaks down how large language model API billing actually works and why a pricing change that makes model-initiated search free often leaves the total bill unchanged. It explains the five cost layers behind every request, walks through the compounding effect of growing context in agent loops, and highlights off-peak discounts, context governance, prefix caching, tool budgets, and batch processing as the levers that genuinely reduce cost. A reusable estimation formula and four practical recommendations help teams evaluate pricing changes against their own usage instead of headlines.

    A Price List That Lived for Five Days

    Late Friday night, a model platform published a new price list on its documentation site. Five capabilities were priced separately: search, web fetching, document parsing, speech recognition, and content moderation. I was wrestling with a web-scraping script at the time, so I saved the page to my bookmarks. Expensive, I thought, but not outrageous.

    The page survived five days. Starting at noon on November 18, the portion triggered by the model autonomously deciding to search was no longer billed separately. Retrieved content gets stuffed into the context and settled per token. The official documentation is explicit: retrieval and fetching triggered by the built-in web tools are free.

    I missed that on my first read. The circulating summary was “search is free,” and I went along with it, quietly giving the platform some credit, until I reached the billing rules and backtracked. The only free part is the segment where the model decides to search on its own. Call the retrieval and fetching APIs directly in your code and you pay every cent.

    The difference is who presses the button.

    Anyone who has used an agent knows you never get to press it. You send one sentence, and it searches a dozen or twenty times and pulls back a few pages. Previously every search passed through a toll booth; now the booth is gone.

    Somewhere along the way this turned into “a major price cut.” I get it, a line item did disappear from the bill. But spread it out and the retrieved pages were already fed into the context by the character, not one token fewer. The cost simply moved from a retrieval fee into an input fee. It is like a cafeteria folding the price of rice into a set meal: the sticker price does not change, and you did not eat an extra bite.

    How much does it save? I ran a mid-sized task with estimated numbers: 30 web-enabled turns, 200,000 input tokens, 40,000 output tokens, at peak pricing. Before the change, $0.93; after, $0.77. Retrieval fees accounted for 17%. Sixteen cents. Five days of commotion to save less than a bottle of water.

    The part that dominates the bill did not move a cent.

    Break Down the Bill First: You Are Not Buying “One Call”

    To judge whether a billing adjustment is genuinely cheaper or only looks cheaper, accept one thing first: an LLM API bill has never been “number of calls × unit price.” It is the sum of several cost layers. Pulled apart, there are at least these:

    • Input tokens: system prompts, conversation history, retrieved page bodies, structured tool results. This is usually the largest cost source in long tasks.
    • Output tokens: the generated portion, typically priced significantly higher than input, billed per million tokens.
    • Capability add-on fees: search, fetching, document parsing, speech recognition, content moderation, historically billed in discrete units such as per thousand calls or per minute of audio.
    • Time-of-day multipliers: peak and off-peak pricing differ; this is essentially a price signal for compute supply and demand.
    • Cache and batch discounts: cached input portions and asynchronous batch jobs often carry separate discounts.

    Put these five on one diagram and you can see exactly which lever “free search” pulled: it moved part of item 3 into item 1. The change in your total bill depends on how much retrieved content your task carries, how high your context repetition rate is, and when you run the job.

    Why “Free Retrieval” Does Not Mean “Free”

    The autonomous retrieval chain looks roughly like this: the model decides information is insufficient → issues a search → gets several results → extracts the body text → splices it into the context → continues reasoning, possibly another round. Every round appends more content to the context, and the context accumulates linearly.

    Illustrative pseudocode:

    1. messages = [{"role": "system", "content": SYSTEM_PROMPT}]
    2. for turn in range(max_turns):
    3. resp = client.chat(model=MODEL, messages=messages, tools=TOOLS)
    4. messages.append(resp.message)
    5. if not resp.tool_calls:
    6. break
    7. for call in resp.tool_calls:
    8. # Retrieval triggered autonomously by the model is no longer billed separately
    9. result = web_search(call.query) if call.name == "search" else fetch(call.url)
    10. messages.append({"role": "tool", "content": result.body})

    Look at the messages list: it only grows. By turn 10, the retrieved bodies from the previous nine turns are all still in there, and every turn is billed for them again. In other words, one “free” retrieval can be billed repeatedly across the next five to ten turns. The retrieval fee vanished; input tokens ballooned.

    That is why so many people look at the month-end bill and find the total barely changed. The cost did not disappear, it just switched accounts, and because the billing unit changed from “per call” to “per token,” it became harder for intuition to notice.

    The Line That Actually Matters: 50% Off During Off-Peak Hours

    The line most worth reading on that price list was not “free search.” It was the time-of-day discount.

    Peak is usually a few consecutive stretches during weekday daytime; off-peak is nights, weekends, and public holidays. For the same model tier, off-peak pricing can be half of peak. This is not new. Cloud providers have done it for over a decade: nighttime electricity is cheaper, so data centers pile non-urgent work into the night. Compute works the same way. GPUs are short during the day and half idle at night; without a price gap, nobody would submit jobs in the middle of the night.

    So the first optimization principle is: check what time your work actually runs.

    • Web scraping, data cleaning, and batch summarization whose results are only needed overnight;
    • Offline batch jobs, regression evaluations, and log analysis due over the weekend;
    • Scheduled inspections and report generation that run when users are absent;

    Move these to off-peak and the cost is cut in half, with no logic changes, only a scheduling config change.

    1. # Pseudo-config: route tasks to different tiers by urgency
    2. schedule:
    3. - name: nightly-crawl
    4. cron: "0 2 * * *"
    5. tier: off-peak
    6. - name: hourly-moderation
    7. cron: "0 * * * *"
    8. tier: peak

    Context Governance: More Effective Than Switching Models

    If time-of-day optimization is “free money,” context governance is “money you should never have spent.” The engineering options that actually work:

    One, compress retrieval results before they enter the context. Scraped pages run thousands of characters, and dumping the whole thing in is the most expensive approach. Extractive summarization, stripping ads and navigation, keeping only paragraphs relevant to the question can usually shrink the volume by an order of magnitude.

    Two, enable caching for repeated prefixes. System prompts, tool definitions, and long documents that stay unchanged every turn cost noticeably less once they hit prefix caching. The prerequisite is placing them at the very front of the message array and keeping them byte-stable. Do not embed timestamps or random IDs in the system prompt.

    Three, cap the agent’s turns and tool budget. Set an upper bound on the loop and a quota on searches so the model does not fall into an endless “search, read, search again” cycle.

    1. budget = {"search": 8, "fetch": 5, "turns": 12}
    2. # Degrade when over budget: fall back to cached results or answer with explicit uncertainty

    Four, use a sliding window plus summarization for history. Do not resend long conversations in full. Keep the most recent turns verbatim and compress earlier turns into structured summaries.

    Five, turn discrete capability calls into batch jobs. Document parsing, speech recognition, and content moderation are billed per call or per minute. Anything that can be asynchronous should go through a batch queue; most platforms offer separate discounts for asynchronous jobs.

    A Reusable Cost Estimation Model

    Do not judge “how much this adjustment saved” by feel. Turn the bill into a formula:

    1. Total cost ≈ input tokens × input price × time-of-day multiplier × (1 - cache hit rate × cache discount)
    2. + output tokens × output price × time-of-day multiplier
    3. + Σ(discrete capability call volume × corresponding unit price)

    Fill in a month of real usage and do three things:

    1. Compute each cost item’s share and find the top two (usually input and output tokens together exceed 80%);
    2. Change the time-of-day multiplier for deferrable tasks from 1.0 to 0.5 and see the total change;
    3. Raise the cache hit rate from 0 to 0.4 and compute again.

    Most teams find after these three steps that the optimization headroom far exceeds anything a single price list adjustment delivers.

    Four Practical Recommendations for Teams

    • Build usage observability. Instrument by business line, by endpoint, and by token type, and pipe it into logging and alerting. You cannot optimize what you cannot see.
    • Bake “time of day” into the architecture. The scheduling layer should separate real-time from offline paths, with offline jobs defaulting to the off-peak queue.
    • Write a “context budget” into coding standards. Every agent needs a turn cap, a retrieval quota, and a maximum length per tool result.
    • Consolidate capability calls behind a gateway. Route search, parsing, and moderation through an internal gateway for rate limiting, caching, and unified billing accounting.

    Conclusion

    Back to the original question: is this price acceptable? The more accurate framing is that no billing change should be judged as “cheaper” or “more expensive.” You have to run it against your own usage structure. Folding retrieval fees into input fees benefits short-context, low-retrieval calls; for long-chain agents and scenarios that repeatedly scrape pages, it is nearly imperceptible or even more expensive. Only three levers reliably cut costs: move non-urgent work to off-peak, compress the context as short as possible, and cache repeated prefixes.

    People who understand bill structure will not be led around by the wording of a price list.