◈ CompareInference
GUIDES / RESEARCH

How LLM Inference Pricing Works: Per-Token, Cached Input, Batch and GPU-Hour Billing Explained

Learn to compare token, cached-input, batch and GPU-hour inference billing with pricing formulas and workload-based cost checks.

Technical guide

Learn how open-weight LLM API pricing works across tokens, cached input, batch jobs and GPU billing, with practical cost examples from CompareInference.

Hosted open-weight inference is billed by token usage or by deployed capacity, under provider-specific rules. Open weights don’t remove hosting charges or license obligations. This guide explains per-token, cached-input, asynchronous batch, and dedicated-capacity billing (including GPU-hour charges), then shows how to compare costs at the workload level. Prices quoted are as of November 11, 2026.

How LLM Inference Billing Works for Open-Weight Models

LLM inference billing measures either the tokens a model processes or the capacity available to run it, and open-weight models can be billed either way. CompareInference’s evaluation framework separates usage charges from capacity commitments, including idle GPU costs, reserved throughput, and support contracts, so you don’t end up comparing a token price with a capacity rate that covers different things.

Per-token billing: input and output

Per-token APIs commonly publish separate prices per million input tokens and per million output tokens. Input (the prompt) and output (the completion) therefore contribute separately to the bill.

For a request without caching or other discounts, the calculation is:

Request cost = (input tokens × input rate + output tokens × output rate) ÷ 1,000,000

Both rates must be expressed per million tokens. Comparing only the input rate leaves out the completion charge. OpenRouter, for example, calculates request costs using provider-reported usage and deducts those costs from prepaid credits. Tokens determine the request charge, while credits fund it.

Cached-input billing: discounted input, not extra tokens

Cached-input pricing applies a different rate to eligible input that successfully matches cached content. It doesn’t add a separate quantity of input on top of the prompt total.

Groq makes this distinction explicit in its usage fields:

To calculate the input charge, split total input into uncached and cached portions, then apply their respective rates. Do not add cached tokens to total input again.

Groq’s caching is automatic on supported models, requires matching cached content, and discounts successful cache-hit input by 50% with no additional caching fee. Hits depend on matching content, so budget from measured hit rates.

Batch billing: asynchronous jobs and eligibility rules

An asynchronous Batch API accepts work for later processing instead of returning an immediate response. Groq, for example, uses uploaded JSONL requests and asynchronous result retrieval, with configurable processing windows from 24 hours to seven days. It’s built for offline work, not real-time chat.

Groq offers a 50% discount against synchronous prices on supported models. That discount does not stack with prompt caching: all batch tokens receive batch pricing regardless of cache status.

Other providers set their own eligibility rules. Together AI offers discounts of up to 50% for selected batch models; unlisted models run at standard rates, and dedicated inference does not receive the batch discount. Fireworks prices asynchronous batch inference at 50% off its serverless per-token rates.

A Batch API is also different from serving-engine batching. An engine can batch requests to increase aggregate throughput and lower dedicated cost per token, with possible trade-offs in individual-request latency. That scheduling mechanism is separate from submitting asynchronous jobs under a batch pricing program.

GPU-hour pricing: capacity rates versus billing increments

A GPU-hour price is a rate for capacity; it doesn’t mean the provider bills in whole hours. Fireworks on-demand deployments are metered per GPU-second with no charge for startup time, even though its rate card also shows hourly prices.

Together AI bills dedicated inference by the minute for each ready replica, regardless of token or request volume. Provisioning and cold-start time are excluded, and billing stops when replicas scale down. Ready but idle replicas still incur charges, so minimum replica settings set a cost floor.

Together lists an H100 80GB at $5.49 per GPU-hour and a B200 180GB at $8.99 per GPU-hour. Configured GPU counts multiply the single-GPU rate, and additional replicas bill independently. A comparison therefore needs the GPU count, replica count, and billable ready time, not just the headline hourly rate. Low or bursty traffic generally favors serverless token billing, while sustained utilization can favor dedicated capacity.

Capacity-unit billing for imported models

Amazon Bedrock Custom Model Import is a managed API that doesn’t use ordinary token billing. It uses Custom Model Units, with active model copies billed in five-minute windows. Required units depend on model characteristics, and AWS also lists monthly model storage charges.

Billing modelWhat is meteredDocumented exampleWhat to check
Per-tokenInput and output token counts at separate ratesOpenRouter calculates charges from provider-reported usageCompare both input and output rates, not input alone
Cached inputCache-hit input within the total input countGroq discounts successful cached input by 50%Supported models and matching content are required
Asynchronous batchTokens processed under an eligible batch programGroq offers 50% off supported synchronous prices; Together offers up to 50% on selected modelsEligibility varies; Groq’s cache and batch discounts do not stack
GPU capacityBillable capacity time and configured resourcesFireworks meters per GPU-second; Together bills ready replicas by the minuteThe hourly price isn’t the billing increment; idle ready capacity still bills
Imported-model capacity unitsActive model copies through Custom Model Units, plus listed storage chargesBedrock Custom Model Import uses five-minute billing windowsImported models do not support batch inference

Bedrock’s batch discounts for selected foundation models don’t apply to imported weights, because Custom Model Import doesn’t support batch inference.

Why Workload-Based LLM Pricing Comparisons Matter in 2026

A low advertised token rate isn’t the same as the lowest cost for your workload. Comparisons need consistent model assumptions, input/output mix, utilization, and service requirements. Baseten identifies batch size, traffic utilization, and input/output sequence lengths as major variables in dedicated inference costs, and recommends comparing total API spend against total dedicated spend. Scheduling also changes the comparison: DeepInfra lists Standard at 1× base price, Priority at 1.5×, and Flex at 0.8×. Flex’s lower rate comes with slower responses and occasional unavailability, so it isn’t the same service at a lower price.

Normalize the model and workload first, then compare total spend under the service requirements you need, keeping token usage charges separate from dedicated capacity commitments, idle GPU costs, reserved throughput, and support contracts.

Common LLM Pricing Mistakes and How to Avoid Them

An LLM cost estimate can use the correct published rates and still miss the actual bill. Common errors come from counting token categories incorrectly, applying discounts outside their eligibility rules, or leaving capacity and platform charges out of the budget.

Common LLM billing problems encountered

  1. Double-counting cached input. Groq reports total input in prompt_tokens and cache-hit input in prompt_tokens_details.cached_tokens. Cached tokens are already part of total input, not extra tokens. For cache-priced requests, subtract cached tokens from total input before applying the uncached rate, then price the cached portion separately.
  2. Assuming discounts apply everywhere or stack. Groq’s 50% batch discount does not stack with prompt-caching discounts: all batch tokens receive the batch rate regardless of cache status. Together AI’s batch discounts are model-specific; unlisted models run at standard rates, and dedicated inference does not receive the batch discount. Amazon Bedrock’s batch discounts for selected catalog models don’t apply to imported weights, because Custom Model Import doesn’t support batch inference.
  3. Budgeting only visible output and token list prices. OpenRouter bills reasoning tokens as output, so the visible final answer undercounts billed generation. OpenRouter passes through provider inference prices without markup, but credit purchases carry a separate fee, and bring-your-own-key allowances and fees depend on the plan. Include those charges in the budget.
  4. Ignoring ready-but-idle capacity. Dedicated capacity costs money even when it isn’t serving requests. Together AI’s minimum replica settings set a cost floor. Check that floor against expected utilization instead of estimating dedicated costs only from periods of active generation.

Before comparing estimates, reconcile cached and uncached usage, check discount eligibility and stacking rules, include all billed output and applicable fees, and account for minimum capacity commitments.

What to Look for When Comparing Open-Weight LLM API Pricing

A fair comparison needs more than a headline token rate. Record the model, service level, usage assumptions, and billing conditions behind each estimate so a lower apparent price doesn’t hide a different capacity commitment or operating requirement.

Must-have pricing and usage information

CompareInference’s provider directory and side-by-side comparisons, which flag unpublished information, can help you organize this research and the questions to ask each provider.

How Teams Calculate and Compare LLM Inference Costs

Start with a fixed workload, then calculate each billing model against it. The workflow below separates provider-published rates from derived arithmetic and keeps token charges distinct from dedicated-capacity commitments. The goal is a comparable full-bill estimate, not a comparison of isolated headline prices.

Strategy 1: Define a comparable workload

Hold the model, total input and output volumes, input/output sequence lengths, traffic pattern, and service requirements consistent across alternatives. Record these assumptions before collecting prices so a cheaper configuration doesn’t quietly become a different workload.

For dedicated inference, include batch size and traffic utilization in the evaluation. Baseten identifies both, along with sequence lengths, as major cost variables.

Decision output: a shared workload specification for evaluating token-based APIs, asynchronous batch processing, and dedicated capacity.

Strategy 2: Calculate input, cached-input, and output charges

For an endpoint with separate rates for these three token categories, use the following formula. All rates must be expressed per million tokens:

Token cost = ((total input tokens − cached input tokens) × input rate + cached input tokens × cached-input rate + output tokens × output rate) / 1,000,000.

Add applicable fees separately.

Together AI lists GLM-5.3-Flash at $0.15 per million input tokens, $0.03 per million cached-input tokens, and $0.50 per million output tokens. These rates are specific to this model.

The following table works through 10 million total input tokens, including 6 million cached tokens, plus 2 million output tokens. Subtracting cached input leaves 4 million uncached input tokens.

Token categoryBillable tokensRate per millionCost
Uncached input4,000,000$0.15$0.60
Cached input6,000,000$0.03$0.18
Output2,000,000$0.50$1.00

Total: $1.78 before other applicable charges. Without cache hits, the same workload costs $2.50: $1.50 for 10 million input tokens plus $1.00 for output.

Calculation output: an itemized token bill that shows the effect of cached-input pricing.

Strategy 3: Measure the actual cache-hit rate

Replace assumed cache usage with reported usage. Groq defines the token cache-hit rate as:

Cache-hit rate = cached_tokens / prompt_tokens × 100%.

Use the reported cached-token and prompt-token counts for the workload being evaluated, and feed the measured cached-token count back into the token-cost formula.

Calculation output: a cache-adjusted estimate grounded in actual usage, with the uncached portion still billed at the standard input rate.

Strategy 4: Price eligible offline jobs separately

Identify work that can tolerate asynchronous completion before combining it with interactive traffic. Together AI recommends batch processing for classification, evaluations, synthetic data, and offline summarization.

Evaluate those jobs using the applicable batch pricing and completion requirements. Together AI’s 24-hour completion window is a best-effort target (not a guaranteed deadline); successful batch responses are billed, and failed requests are not.

Decision output: a separate estimate for eligible offline work, and a clear call on whether its timing requirements fit batch processing.

Strategy 5: Calculate dedicated capacity spend

For each replica, collect billed runtime, configured GPU count, and the applicable GPU rate. Convert runtime to the rate’s time unit before multiplying (for example, use hours with a GPU-hour rate).

The compute formula is:

Dedicated compute spend = Σ across replicas (billed runtime × configured GPU count × GPU rate).

Keep capacity commitments, idle GPU costs, reserved throughput, and support contracts separate from usage-based token charges when building the full comparison.

Calculation output: total dedicated compute spend over the same evaluation period used for the API workload, with other applicable charges listed separately.

Strategy 6: Compare full bills under the same requirements

Using measured output from the dedicated deployment, calculate:

Effective cost per million output tokens = total dedicated spend / actual output tokens × 1,000,000.

This is a derived normalization metric, not a list price. Compare the dedicated total with the API’s full input-plus-output bill for the same workload, not with its output-token rate alone. Batch size, utilization, and sequence lengths all move the break-even point.

The final comparison should keep the same workload and service requirements while showing token charges, measured cache usage, eligible batch work, and dedicated capacity separately.

Best Practices for Budgeting Open-Weight LLM Inference

Build a budget around documented billing rules and your workload’s requirements, not just the lowest advertised token rate. Use this checklist to keep assumptions explicit and comparisons consistent.

Benefits and Trade-Offs of Each LLM Billing Model

The right billing model depends on traffic patterns, tolerance for deferred processing, and eligibility for provider discounts.

How CompareInference Helps You Evaluate LLM Pricing

CompareInference provides an AI inference provider research directory and a side-by-side comparison workspace to help teams build shortlists. The workspace lets you select two platforms for a qualitative overview and flags information that providers haven’t published. Its pricing methodology separates token usage charges from dedicated capacity commitments, idle GPU costs, reserved throughput, and support contracts, and normalizes prices across models before comparing them.

Key Takeaways and Next Steps for Comparing LLM Inference Costs

Open-weight availability doesn’t make hosted inference free. Compare full bills for the same model, workload, and service requirements, not just headline rates. Account for token categories, discount eligibility, metering increments, utilization, and applicable fees, and keep usage charges separate from dedicated capacity commitments, idle GPU costs, reserved throughput, and support contracts.

Before choosing a provider, define your workload and check current pricing terms, since rates change often. Use CompareInference to research providers, compare deployment options, and build a shortlist, then confirm current rates, eligibility conditions, and service terms with the providers you shortlist.

FAQs About Open-Weight LLM API Pricing

How does LLM API pricing work for open-weight models?

Open-weight LLM APIs charge either for tokens processed or for serving capacity. Per-token pricing commonly separates input and output rates, quoted per million tokens. Cached input may have its own rate, and asynchronous batch processing can use discounted pricing. Capacity-based services bill for resources over time, so their charges don’t track token volume directly. Check which billing mechanism applies to the endpoint you’re pricing.

Does open-weight mean an LLM API is free?

No. Open-weight availability doesn’t remove the cost of hosted execution or the obligation to comply with the model’s license. Amazon Bedrock, for example, supports importing customized models but charges for running inference and requires compliance with applicable model licenses. Access to weights and payment for a hosted service are separate questions, so budget the hosting charges and check the license before treating an open-weight model as a free alternative to a paid API.

How do I calculate cached-input costs without double-counting?

Subtract cached input from total input before applying the ordinary input rate. With rates per million tokens, use: cost = ((total input − cached input) × input rate + cached input × cached rate + output × output rate) / 1,000,000. This assigns each input token to one billing category. Add any separately applicable fees.

Do cached-input discounts stack with batch discounts?

It depends on the provider. Groq says its Batch API’s 50% discount against synchronous pricing on supported models doesn’t stack with prompt-caching discounts; all Groq batch tokens receive the batch rate regardless of cache status. For Groq, don’t apply a cached-input discount and then halve the result again. Check each provider’s documentation for how its discounts interact.

What is the difference between a GPU-hour rate and the billing increment?

A GPU-hour rate is a price; the billing increment determines how usage time is metered. Together AI bills dedicated inference by the minute for each ready replica, regardless of token volume, with no charge for provisioning or cold starts. Fireworks on-demand deployments are metered per GPU-second with no charge for startup time, even though prices are also shown in hourly units. An hourly rate card doesn’t mean hour-long billing increments.

When is dedicated GPU capacity cheaper than a per-token API?

Dedicated capacity is cheaper when its total billed compute spend falls below the API’s full input-plus-output bill for the same workload. Calculate dedicated spend by summing each replica’s billed runtime multiplied by its configured GPU count and rate, using matching time units. Actual utilization, batch size, input/output sequence lengths, and GPU configuration all affect the result, so the break-even point is specific to your workload.

Does Amazon Bedrock bill imported open-weight models per token?

No. For Custom Model Import, Amazon Bedrock uses Custom Model Units rather than per-token billing. Active model copies are billed in five-minute windows, and the required units depend on model characteristics. AWS also lists monthly model storage charges. Custom Model Import doesn’t support batch inference, so Bedrock’s discounted batch pricing for selected catalog models doesn’t apply to imported weights.

Sources and verification

Pricing and billing examples cross-checked against provider documentation on November 11, 2026. Rates and eligibility can change; confirm current terms with providers. This is source-led research, not an independently reproduced performance or cost benchmark.