LLM API Billing and Cost Optimization: Why Free Search Does Not Mean Lower Costs

    This article explains how an updated LLM API pricing model treats search and scraping under Agent mode versus explicit API calls, using a hypothetical bill to show that search fees can be a small share of total cost while token usage dominates. It also covers off-peak discounts and practical engineering practices for reducing LLM API costs without sacrificing output quality.

    The platform recently updated its API suite pricing, covering five capabilities: web search, web scraping, document parsing, speech recognition, and content moderation. A claim has circulated in developer communities that “search is free.” A closer look at the billing rules shows that this is a change in billing method, not the disappearance of cost. This article explains the billing logic, uses a hypothetical bill to calculate the actual share of search fees, and provides practical cost-reduction approaches. Prices and rules are based on the platform’s latest billing documentation.

    1. Where Did the Search Fee Go: Agent Mode vs. Explicit Calls

    Under the new rules, billing depends on who triggers the search.

    The first case is Agent mode. The model decides when to search and when to scrape web pages. In this mode, the platform no longer charges a separate search fee. Scraped web page content is used as context input and billed as ordinary tokens.

    The second case is explicit calls. Code directly calls the independent Search or Fetch API and is still billed per call. The reference price given is USD 0.75 per 1,000 calls.

    The two approaches compare as follows:

    Item Agent Mode Explicit Search / Fetch Calls
    Search fee Not charged separately Billed per call
    Web page content Counted as input tokens Depends on whether code feeds results back to the model
    Main cost source Total input tokens Search calls plus token fees

    Whether failed scrapes or retries are billed is not specified and should be confirmed in the platform documentation.

    Agent mode lowers the decision threshold for each tool call, allowing the model to perform multiple rounds of search and scraping. The trade-off is that web page body text can consume a large amount of input tokens. Only the search item is free; context overhead remains.

    2. Calculating Costs with a Hypothetical Bill

    The numbers below are hypothetical calculations for illustration and do not represent the platform’s actual prices. Assume a moderately complex web-connected Agent task with 30 searches, 200,000 input tokens, and 40,000 output tokens. Assume an input price of USD 1 per million tokens and an output price of USD 4 per million tokens. The search price is calculated at the reference price of USD 0.75 per 1,000 calls.

    The calculation is as follows:

    • Search fee: 30 ÷ 1000 × 0.75 = USD 0.0225
    • Input token fee: 200000 ÷ 1000000 × 1 = USD 0.2
    • Output token fee: 40000 ÷ 1000000 × 4 = USD 0.16
    • Token total: USD 0.36

    Under the old rules, the total cost is USD 0.3825; under the new rules, it is USD 0.36. The search fee accounts for 0.0225 ÷ 0.3825 of the old total, or about 5.9%. After removing the search fee, a single task saves only about USD 0.02.

    This result has two implications. First, the search fee itself is small—less than 6% of total cost in this hypothetical. Second, tokens dominate the cost. Input and output unit prices, context length, and output length together determine the absolute bill.

    For actual measurement, replace the unit prices above with the platform’s current price list. Also distinguish between input, output, and cache-hit prices; cache pricing is usually different from ordinary input pricing.

    3. Off-Peak Discounts: How to Decide Whether They Apply

    According to the description, the platform’s time-of-use rules are roughly as follows: certain peak hours on weekdays are billed at standard prices, while off-peak periods such as nights, weekends, and holidays are priced at about 50% off. Before use, check the following:

    • The specific peak and off-peak time periods, and the corresponding time zone
    • The applicable models and APIs—not all models participate
    • Whether the off-peak discount can be combined with other discounts
    • How billing time is determined when tasks are queued or run across time periods

    Time-of-use billing has a long history in cloud computing. Cloud platforms use idle nighttime resources to offer lower prices for non-real-time tasks and encourage users to shift compute to off-peak hours. LLM compute also has peaks and troughs, and platforms use price differences to guide task migration for the same reason.

    For developers, the most direct use is to move asynchronous tasks to off-peak hours. Typical asynchronous tasks include batch web page analysis, nightly data aggregation, and weekend reports. These tasks are not latency-sensitive and only require adjusting scheduling time. The prerequisite is that the scheduling layer supports timed triggers.

    4. Engineering Practices for Cost Reduction

    1. Separate Real-Time Tasks from Batch Processing

    Use a message queue to separate the two types of tasks. Real-time requests such as customer service Q&A remain in peak hours. Data cleaning, long-text summarization, and log analysis enter a batch queue and are consumed by scheduled jobs during off-peak windows.

    Parameters that can be set include: the timeout for batch tasks, the maximum number of retries (for example, 3), and the start and end times and time zone of the off-peak window. The window should be written into configuration, not hardcoded in business logic.

    Acceptance metrics are the consumption completion rate of the off-peak queue and the token cost comparison for the same batch of tasks before and after the change.

    2. Control Context and Output Length

    Passing the full history on every call causes input tokens to grow quickly. Use vector retrieval to include only relevant snippets, or use a summarization model to compress the history first. The prompt should also explicitly require concise output to avoid useless long paragraphs from the model.

    Parameters that can be set include: the input token limit per request and the maximum output token count (max_tokens). When the limit is exceeded, truncate or summarize first, then call the main model.

    Acceptance metrics are the average input and output token usage for each task type, tracked weekly.

    3. Match Model Tier to Task Difficulty

    Different tasks have different requirements for model capability and should be matched to appropriate tiers.

    Task Type Recommended Tier Scheduling Strategy
    Complex reasoning, critical decisions Pro tier Real-time execution
    Web extraction, format conversion, intent classification Flash tier or a lighter model Real-time or off-peak
    Cold-data batch analysis Choose based on quality requirements Prioritize off-peak

    Specific tier names and prices are subject to the platform documentation.

    Acceptance metrics are the success rate and retry rate for each task type. If the success rate of a lightweight model drops significantly, upgrade that task type to a higher tier.

    4. Hybrid Deployment and a Unified Gateway

    Large teams can place public cloud LLM APIs and self-hosted inference services behind the same gateway. Sensitive data or high-frequency simple tasks are routed to the self-hosted cluster, while complex tasks go to public cloud models. The self-hosted cluster can use spot instances or the off-peak billing options offered by cloud providers, but operating costs and capacity risks must be evaluated.

    Parameters that can be set include: routing rule criteria (task type, data sensitivity level, input length threshold) and the capacity limit of the self-hosted cluster.

    Acceptance metrics are the comprehensive cost per task, which should include API fees, GPU fees, and operations labor.

    5. What to Verify Before Reducing Costs

    1. Use the platform’s latest billing documentation as the source of truth, especially for the trigger rules for search and scraping and the scope of off-peak discounts.
    2. Measure using your own real call logs, not only example numbers.
    3. After each adjustment, record token usage and task success rates to confirm that cost reduction has not affected output quality.

    Rather than waiting for price cuts, it is better to understand the bill structure first. The claim that search is free is worth verifying, but cost is still determined by total tokens and by when and with which model a task is executed.