Estimating Costs for LLM API Bundles: Billing Breakdown and Monthly Modeling

    This guide explains how bundled LLM API platforms charge for text inference, web search, page crawling, and speech services. It shows how to model monthly costs with a reusable template and lists the metrics to record during load testing. All prices are examples. Check the provider's current announcements and invoices for actual rates.

    1. How the Three Billing Methods Work

    Bundled API platforms usually meter services with three different units. Each unit has its own cost drivers.

    Billing method Unit Typical service Main cost drivers
    Per token Per million input or output tokens Text inference Prompt length, output length, model tier
    Per call Per thousand calls Search, web crawling Agent call frequency and retry count
    Per duration Per hour of audio Speech-to-text Total audio duration, add-on features

    Token-based billing determines the base cost of the model. Per-call and per-duration billing determine the cost of tool calls. A bundle invoice is the sum of all three, so looking only at unit prices tends to underestimate the total.

    2. Token Billing: Output Costs Much More Than Input

    Take a lightweight model from a major provider as an example. During weekday peak hours, input costs 2 CNY per million tokens and output costs 8 CNY per million tokens. Output is priced at four times the input rate, which is common across the industry.

    The difference comes from how the two stages run. Input tokens are processed in parallel during the prefill stage, so GPU utilization is high. Output tokens are generated one at a time during the decode stage. Each token requires a full forward pass, and decoding is limited by KV cache memory bandwidth, so throughput is much lower.

    This means limiting output length usually saves more money than shortening the input prompt. For example, asking the model to give the conclusion first and then a short rationale is much cheaper than asking for a full step-by-step derivation.

    Off-peak pricing and load shifting

    During off-peak hours, the provider charges half the peak price. The price gap is a way for the provider to shift demand from peak hours to low-load periods.

    For developers, this is a clear optimization signal. Tasks that do not need real-time responses, such as offline batch inference, document summarization, data labeling, and benchmark evaluation, can run during the lower-price window. The following example checks whether the current time falls in that window:

    1. from datetime import datetime
    2. from zoneinfo import ZoneInfo
    3. BEIJING = ZoneInfo("Asia/Shanghai")
    4. def is_off_peak(now=None):
    5. """Check whether the current time falls in the off-peak, lower-price window.
    6. This example treats 9:00-21:00 on weekdays as peak hours."""
    7. now = now or datetime.now(BEIJING)
    8. is_weekday = now.weekday() < 5
    9. is_peak_hours = 9 <= now.hour < 21
    10. return not (is_weekday and is_peak_hours)
    11. # Batch job scheduling example
    12. if is_off_peak():
    13. run_batch_inference(job_queue)
    14. else:
    15. queue_task_for_offpeak(job_queue)

    This code has several limitations. First, it uses an explicit timezone, so the result does not depend on the server’s local timezone. Second, it does not handle public holidays or read the provider’s pricing schedule changes, so update the rules to match current announcements before use. Third, polling inside a script is not recommended for production. A safer approach is a scheduler with explicit timezone settings or a cloud scheduling service that triggers batch jobs during the low-price window, with a message queue holding the tasks until then.

    3. Per-Call Billing: How Search Costs Multiply

    Search and web crawling cost 5 CNY per thousand calls, or 0.005 CNY per call. A single call is cheap, but agent applications make many tool calls. Planning, reflection, multi-round retrieval, and failed-request retries all add calls.

    Assume a user session makes an average of 20 search calls. The search cost per session is then 0.1 CNY. With 100,000 sessions per day, search alone costs about 10,000 CNY per day, or about 300,000 CNY per month. This figure does not include model inference costs.

    Therefore, count the tool calls by replaying real tasks before launch instead of estimating from intuition. It is also advisable to set a limit on search and crawl calls per session in the agent framework. When a session exceeds the limit, a circuit breaker should trigger, so a looping task cannot run without control.

    4. Per-Duration Billing: Speech-to-Text

    Transcribing one hour of audio costs about 0.39 CNY, or roughly 0.0065 CNY per minute. At this price, speech costs for meeting notes, podcast transcription, and call quality review are usually modest.

    Confirm the following billing terms before using this price:

    • Billing is based on audio duration, not processing time.
    • Speaker diarization, dialect recognition, and other add-on features may be billed separately.
    • Failed requests may or may not be billed, and retries may be billed again.
    • The 50% discount is limited-time. Check the provider’s announcement for the terms. After the promotion ends, the price returns to the list rate.

    Two more points matter during evaluation. Long audio files usually need to be split into segments, so check the limits on single-file duration and concurrency. Accuracy must be measured on your own real recordings. Do not rely on the accuracy figures in marketing materials.

    5. Judging Whether the Cost Is Reasonable: Monthly Cost Modeling

    Unit prices mean little without the business context. The cost of a single request is calculated with this formula:

    Cost per request = input tokens ÷ 1,000,000 × input price + output tokens ÷ 1,000,000 × output price

    Consider a typical customer service Q&A. The input is 800 tokens, including the system prompt and retrieved context, and the output is 300 tokens. The cost at peak prices is:

    • Input: 800 ÷ 1,000,000 × 2 = 0.0016 CNY
    • Output: 300 ÷ 1,000,000 × 8 = 0.0024 CNY
    • Total: 0.004 CNY, or about 4 CNY per thousand Q&A requests

    At an average of 1 million requests per day, inference costs 1,000,000 ÷ 1,000 × 4 = 4,000 CNY per day. Over 30 days, monthly inference costs about 120,000 CNY. This covers only model inference. It excludes search, crawling, and speech costs, and it does not include retries or cache effects.

    For comparison, if every request could run in the off-peak window, the same calculation gives a monthly inference cost of about 60,000 CNY. Real workloads cannot shift entirely off-peak, so treat this figure as a lower-bound reference.

    Fill in the template below line by line, then compare the result with the cost of a self-hosted inference cluster, including hardware depreciation, operations staff, and elastic capacity costs:

    Item Example value Notes
    Input tokens per request 800 Includes system prompt and retrieved context
    Output tokens per request 300 Can be reduced by limiting output length
    Input price (CNY per million tokens) 2 Peak-hour price
    Output price (CNY per million tokens) 8 Peak-hour price
    Peak-to-off-peak factor 1 or 0.5 Off-peak requests are priced at half
    Inference cost per request (CNY) 0.004 Calculated with the formula above
    Requests per day 1,000,000 Based on real logs
    Inference cost per day (CNY) 4,000 Cost per request × requests per day
    Monthly inference cost (CNY, 30 days) 120,000 Daily cost × 30
    Tool fees per month (CNY) To be filled in Calculate search, crawling, and speech separately

    6. What to Measure During Load Testing

    Many teams look only at average values during load testing, which underestimates the bill. Collect at least the following metrics:

    1. Call count distribution: Record the average, P95, and maximum number of calls per session. A small number of long sessions often accounts for most of the cost.
    2. Token percentiles: Measure the average and P95 for input and output tokens separately. Do not rely on averages alone.
    3. Retry rate and billing for failed requests: Track the share of timeouts, rate-limited requests, and errors, and check whether failed requests are still billed.
    4. Cache hit rate: If the provider supports context caching, record the hit rate, because it directly affects input-side costs.
    5. Circuit breaking: Track how often circuit breakers trigger. Frequent triggers show that an agent loop is running out of control and driving up tool-call costs.