LLM API Pricing: Compare Costs for Your Workload

By Rome Thorndike · Updated October 28, 2026

A hosted open-model API can cost much less than a premium proprietary model, but “open models are 5–20 times cheaper” is not a reliable budgeting rule. The result depends on which endpoints you compare, the input-to-output ratio, cache reuse, and how many attempts produce a usable result. Low-cost proprietary models can also undercut hosted open models.

This comparison uses published USD rates checked October 28, 2026, followed by reproducible calculations. It covers text generation through paid APIs. The calculations are illustrations, not measurements from a production benchmark. They exclude taxes, negotiated contracts and separately billed tools unless specified.

Our data: token-cost scenarios and sensitivity calculations

We calculate three monthly workloads, four open-versus-proprietary cost ratios, and a cache-reuse example from the published inputs below. These derived scenarios compare token bills, not measured model quality. AI assisted research and drafting; PE Collective owns the analysis and should recheck it when provider rates change.

Selected LLM API prices per million tokens

Read each row as a provider-and-model combination. An open model does not have one universal API price: the host sets its own charges. These are standard processing rates for the stated context band, before cache writes or reads. The table is a useful shortlist, not a claim to cover every available model.

Provider and modelInput / 1MOutput / 1MCondition
Together: Llama 3 8B Instruct Lite$0.14$0.14Hosted serverless endpoint
Together: gpt-oss-120B$0.15$0.60Hosted serverless endpoint
Together: DeepSeek V4.1 Flash 1017$0.30$1.20Together rate, not a direct DeepSeek quote
OpenAI: GPT-6 Luna$0.10$0.50Short context, standard
OpenAI: GPT-6.1 Sol$2.00$10.00Short context, standard
OpenAI: GPT-6 Astra$10.00$50.00Short context, standard
Anthropic: Claude Haiku 5.5$0.10$0.50Prompts up to 100,000 tokens
Anthropic: Claude Sonnet 5.5$2.00$10.00Base direct API rate
Anthropic: Claude Opus 5.5$4.00$20.00Base direct API rate
Google: Gemini 2.5 Flash-Lite$0.10$0.40Paid standard text input
Google: Gemini 2.5 Flash$0.30$2.50Paid standard text input
Google: Gemini 2.5 Pro$1.25$10.00Prompts up to 200,000 tokens

Sources: Together serverless pricing, OpenAI API pricing, Anthropic pricing, and Gemini API pricing. Each provider offers additional models and billing categories. A low listed token rate does not establish equivalent answer quality, latency or availability.

Do not treat an older model name as an interchangeable bargain. A host can retire a model, replace an alias or serve a different quantization. Record the exact endpoint identifier beside the price used in your budget. Before committing to a migration, confirm that the model still accepts your required inputs and tool definitions.

Are open-model APIs really 5–20 times cheaper?

Sometimes, with a particular comparison. At the listed rates, one million input tokens plus one million output tokens costs $0.75 on Together's gpt-oss-120B endpoint and $12 on GPT-6.1 Sol. That is a 16-fold difference in token cost for that equal-token workload. It is not a measured difference in cost per solved task.

The same open-model endpoint costs more than GPT-6 Luna for that workload: $0.75 versus $0.60. Against GPT-6 Astra at $60, it is 80 times cheaper. Both comparisons are arithmetically valid. Neither supports a single discount for the entire open-model category. The appropriate comparison includes a low-cost proprietary candidate as well as a premium candidate.

Input-heavy workloads change the ratio again. With ten million input tokens and one million output tokens, gpt-oss-120B costs $2.10 and Sol costs $30, a difference of about 14.3 times. With one million input and ten million output, the totals are $6.15 and $102, or about 16.6 times. Report your token mix whenever you publish a savings percentage.

The practical decision is whether the cheaper endpoint meets the task's acceptance threshold. A routing classifier needs the right label; a document extractor needs the right fields and evidence; a coding assistant needs a correct change. Those tasks can have different winners. Open weights, parameter count and provider branding are insufficient substitutes for testing representative inputs.

How to compare Llama and DeepSeek fairly

Keep the hosting route fixed when evaluating a specific model, then compare hosts separately. Otherwise a result may combine changes in model version, serving settings, queueing and price. The Llama row above is a small model, while the DeepSeek row is a different family and service. Their dollar difference is not a capability ranking.

For a shortlist, select models that support the same required functions: structured output, tool calls, images if needed, and enough context. Give each the same source material and acceptance rubric, while allowing documented model-specific formatting. Preserve unsuccessful responses and retries in the cost total. A discarded attempt still consumed tokens.

A low-cost open endpoint is a sensible candidate for constrained extraction or routing when it passes those checks. A more expensive endpoint is justified when the improvement in accepted results, speed or reduced human review exceeds the additional bill. That conclusion should come from the workload, rather than a general claim that one model family always handles “routine” work.

The cost formula: input plus output, then extras

For a simple uncached text request, multiply input tokens by the input rate, multiply billed output tokens by the output rate, add the results, and divide by one million. If your price table is already expressed per thousand tokens, use one thousand instead. Mixing those units creates a thousand-fold error.

request cost = (input tokens × input price per million
              + billed output tokens × output price per million) / 1,000,000
monthly token cost = sum of request costs across all attempts

Input includes instructions, conversation history and supplied documents. It can also include tool definitions and previous tool results. The user's latest sentence is only part of the prompt. Output can include model-generated reasoning where the provider bills it, as well as the visible answer. Use the endpoint's usage fields instead of counting words on the screen.

For cached workloads, split input into uncached, cache-write and cache-read categories and apply the appropriate rate to each. Add storage or retention charges where applicable. Avoid charging the same input token at both the ordinary input and total cache-write rate. Provider pricing pages define whether a displayed charge is a total rate or an extra fee.

Keep search, file storage, execution environments and other tools as separate budget lines. A token-only calculation is useful because its assumptions are transparent. It becomes misleading when presented as an all-inclusive application cost while the application makes several tool calls for every answer.

Converting prices to cost per 1,000 tokens

Example endpointInput / 1KOutput / 1K
Together gpt-oss-120B$0.00015$0.00060
GPT-6 Luna$0.00010$0.00050
GPT-6.1 Sol$0.00200$0.01000
Claude Opus 5.5$0.00400$0.02000

These are conversions of the table above, not additional discounts. “A thousand tokens” also does not mean a thousand words. Token counts differ by tokenizer, language, code and formatting. Count a sample with the model's supported tooling or actual usage response before estimating a large document corpus.

Worked monthly budgets for three applications

The examples below use standard uncached rates, no cache writes, no tool charges and no retries. The assumed token volumes are stated so you can replace them with your own. They illustrate the size and direction of costs without claiming that every model will produce equally good results.

Classification: 100,000 requests per month

Assume each request uses 500 input tokens and 20 output tokens. Monthly totals are 50 million input and two million output tokens. GPT-6 Luna costs $5 for input plus $1 for output, or $6. Together gpt-oss-120B costs $7.50 plus $1.20, or $8.70. Sol costs $100 plus $20, or $120.

This is a case where a small proprietary endpoint has a lower token bill than the chosen hosted open endpoint. The important quality check is whether the model assigns the correct label, including ambiguous or out-of-scope examples. Returning a short answer keeps output cost low, but reducing the answer to one token does not compensate for incorrect routing.

Support assistant: 10,000 answers per month

Assume 2,000 input tokens and 500 output tokens per answer. The total is 20 million input and five million output. Together gpt-oss-120B costs $6; Sol costs $90; Opus 5.5 costs $180. These are token-only totals before retrieval, tools, caching or repeated attempts.

Suppose a cheaper candidate requires extra human review. At an illustrative labor cost of $30 per hour, five minutes of review costs $2.50. Reviewing just 100 extra answers adds $250, more than the token difference between these options. This does not show that a particular model requires more review; it shows which measurement can dominate the buying decision.

Document analysis: 1,000 long requests per month

Assume each request contains 100,000 input tokens and generates 2,000 output tokens. Monthly totals are 100 million input and two million output. At the listed short-context rates, Sol costs $220 and Astra costs $1,100. Gemini 2.5 Pro at its up-to-200,000-token prompt band costs $145.

This example assumes all instructions and supplied material fit within the stated prompt size. Additional documents, conversation history or tool outputs can push a request into another band. Splitting documents can reduce cost, but it may also remove relationships needed for an accurate answer. Compare the final result, including cross-document questions, before choosing a smaller context solely for price.

Context thresholds can change the whole estimate

Context capacity and price bands answer different questions. Capacity says how much a model can accept. A price band says what it charges for a request of that size. Having a large advertised context window does not imply the lowest rate applies throughout it.

OpenAI's current flagship table distinguishes short and long context around 272,000 input tokens. For Sol, the long-context rate is $4 input and $15 output per million, rather than $2 and $10. Google lists Gemini 2.5 Pro above 200,000 prompt tokens at $2.50 input and $15 output, rather than $1.25 and $10. Check the exact boundary and billing rule in the linked provider documentation.

For illustration, a 300,000-input, 2,000-output Sol request at those long rates costs $1.23. Multiplying the short rates would produce $0.62, understating the estimate by $0.61 per request. Across ten thousand requests, that mistake becomes $6,100. The arithmetic matters even when the endpoint successfully accepts the prompt.

In a budget spreadsheet, store a context-band column or rule beside the model. Do not average input sizes first and apply one rate to the average if individual requests cross a threshold. Calculate each request's rate category before aggregating; otherwise a small group of large requests can disappear inside the mean.

Prompt caching: calculate reuse, writes and misses

Caching can reduce repeated input costs when requests share an eligible prefix. It does not mean the complete answer is reused for free. You still pay for new input and newly generated output. For implementation details, see OpenAI's prompt-caching guide and the caching categories in each provider's price table.

As a worked Sol example, suppose a stable 10,000-token prefix is written once with the 30-minute option at $2.50 per million and then fully read nine times at $0.10 per million. The prefix costs $0.025 for the write and $0.009 for nine reads: $0.034 total. Ten ordinary uncached copies at $2 per million would cost $0.20.

That is an 83% saving on this prefix component under the stated assumptions. It is not an 83% reduction in the full application bill. Unique user content, output, tools and failed cache matches remain. If every request changes the prefix before the reusable material, the expected read savings can disappear.

Place stable instructions and reference material before changing content when the API permits it. Keep tool schemas stable where practical. Then inspect reported cached-token usage instead of assuming a hit because the conversation looks similar. A prompt that is logically equivalent but differently ordered may not reuse the same prefix.

Longer retention also needs a calculation. A higher write rate can make sense when it produces useful reuse over a longer interval. For one-off documents with no repeat requests, it may add cost without offsetting reads. Compare the total input bill under each retention choice, including misses, rather than optimizing only for the displayed cache discount.

Batch processing versus real-time requests

Batch is suitable for jobs that can wait: offline evaluations, document enrichment, classifications and scheduled processing. It is generally unsuitable for an interactive user waiting for an answer. OpenAI documents a 50% discount and a 24-hour turnaround window for its Batch API; model and endpoint support still need checking.

Using the support-workload token volumes above purely as an offline example, Sol's $90 standard total becomes $45 at half-price input and output rates. That assumes every request qualifies and finishes under the applicable batch terms. It does not discount your database, storage, retrieval service or staff time.

Build batch jobs with stable request IDs, recorded input files and an explicit retry policy. Reconcile returned results to submitted requests. Do not resubmit a whole completed dataset because a few rows failed; that can pay twice for successful rows. Separate invalid inputs from transient failures so retries improve completion instead of repeating a deterministic error.

Compare batch against a cheaper synchronous model as well as the same model's standard rate. A discount from a high starting price may still exceed the undiscounted cost of another acceptable endpoint. Conversely, a stronger model at batch rates may be economical for an overnight process whose result would otherwise require manual correction.

Routing models without hiding the fallback bill

A two-stage system can send easy requests to a low-cost model and escalate difficult ones. Its budget must include both calls for escalated requests. If a classifier or validator makes another model request to decide whether escalation is needed, include that call too.

For illustration, assume the 10,000-request support workload above, with every request first using gpt-oss-120B for $6 total. If 20% then rerun on Sol with the same token sizes, the additional cost is $18, producing a $24 token total. Sending all requests directly to Sol would cost $90. This is a hypothetical routing calculation, not a claimed success rate.

Escalation often carries more context than the first attempt because it includes the failed answer or a validator's explanation. Recalculate using that longer prompt. Also account for the added latency: a cheaper serial workflow may make the product frustrating even when its token bill is attractive.

Choose escalation rules tied to observable failures. Examples include a missing required field, an unsupported citation, a tool error or a failed unit test. A model's unsupported confidence score is a weak substitute for an acceptance check. Audit a sample of apparently successful low-cost results so silent mistakes do not make the routing system look artificially efficient.

API pricing versus self-hosting

Self-hosting replaces per-token charges with infrastructure and operating costs. Open weights can make this possible, subject to the model's license, but they do not make inference free. Budget for accelerators, CPU and memory, storage, network transfer, monitoring, deployments and the people maintaining the service.

A useful break-even calculation compares all monthly self-hosting costs with the API bill for the same accepted workload. Suppose, as an assumption rather than a cloud quote, infrastructure and operations total $3,000 per month. If the equivalent API workload costs $1,000, self-hosting does not save money. If it costs $12,000 and your system meets quality and latency needs, the financial case is different.

Utilization changes the answer. A server sized for a short daily peak may sit idle for most of the day. An API can absorb that uneven traffic without you reserving the entire peak capacity. A steady workload may use dedicated hardware more efficiently, but you need a measured throughput figure for the exact model, hardware, input lengths and concurrency.

There is no defensible universal break-even point such as “ten million tokens per day.” A million short classification outputs and a million tokens generated through long reasoning jobs place different demands on hardware. Include spare capacity and failure recovery in the comparison rather than assuming every accelerator runs productively every hour.

Choosing a model by cost per accepted result

Define acceptance before comparing prices. For extraction, specify required fields and acceptable missing-value behavior. For grounded answers, require support from the supplied source. For code, include tests and review of the change's scope. A response that merely looks polished should not automatically count as success.

Use a representative sample covering ordinary requests, long inputs, ambiguous instructions and cases where the correct behavior is to decline or ask for more information. Keep a separate evaluation set for tuning prompts. Otherwise repeated prompt adjustments can overfit the examples used to choose the cheapest model.

Record total billed usage across first attempts, retries, validation and escalations. Divide that cost by accepted results, then add relevant review labor. Report latency and failure rate alongside cost. An endpoint can win on raw tokens while losing on the time or reliability required by the product.

When there is no clear quality difference on your sample, prefer the operationally simpler option that meets the budget. Adding several providers creates more credentials, error handling, billing reconciliation and model lifecycle work. Routing is worthwhile when its measured savings or resilience justify that complexity.

How output length changes the cheapest-model comparison

Input price often gets the headline, but output can dominate the bill. Keep the request count and input size fixed while changing the expected answer length. The table below assumes 10,000 uncached requests, each with 2,000 input tokens, at the standard rates in the main comparison. It excludes tools, retries, cache operations and quality differences.

Output per requestMonthly outputTogether gpt-oss-120BGPT-6 LunaGPT-6.1 Sol
100 tokens1 million tokens20 × $0.15 + 1 × $0.60 = $3.6020 × $0.10 + 1 × $0.50 = $2.5020 × $2 + 1 × $10 = $50
500 tokens5 million tokens$6.00$4.50$90
1,000 tokens10 million tokens$9.00$7.00$140

For the Sol example, increasing the answer from 100 to 1,000 tokens raises the monthly token estimate from $50 to $140 while the input stays unchanged. The extra $90 is 9 million additional output tokens × $10 per million. That makes answer length a useful variable to measure, but it does not justify truncating information required to complete the task.

Separate requested verbosity from billed reasoning or other output categories. A short visible answer can still consume more billed output than its displayed text suggests. Compare the endpoint's usage report with the response-size assumption, and apply the provider's definition of output rather than a word count from the interface.

A routing break-even calculation

Using the earlier support scenario, let the first-pass gpt-oss-120B route cost $6 for all 10,000 tasks. Sending every task to Sol would cost $90 at the same assumed token sizes. If a fraction p of tasks also needs the full Sol call, the routed token bill is $6 + $90 × p. It is lower than $90 only when p is below 84 / 90, or about 93.3%.

That mathematical boundary is deliberately generous because it ignores validation, longer fallback prompts and latency. If a separate validation step costs an illustrative $30 across the workload, the routed bill becomes $36 + $90 × p. The token-cost break-even fraction falls to 54 / 90 = 60%. These are scenario calculations, not observed escalation rates or a recommendation to accept that many first-pass failures.

Use a measured escalation share and include the validator before deciding routing is economical. Also record silent failures: cases that pass the automatic check but fail human review. A route can appear cheap by accepting incorrect answers, so acceptance and price must be evaluated together. Keep a direct route available for tasks where a second attempt would miss the response-time requirement.

Why a low average can hide a large invoice

Suppose 90% of requests use 2,000 input tokens and 10% use 300,000. The average is 31,800 tokens, but the larger requests still cross a long-context pricing boundary on applicable models. Pricing every request at the rate associated with that average would classify the long requests incorrectly. Group usage by the actual request band first, then add the costs.

Likewise, a median output length can miss a small group of expensive generations. Keep counts and token totals by task type: short classification, interactive answers, long document analysis and retries. That breakdown shows whether a change in the bill came from a higher price, a different workload mix or larger requests.

Record cache hits by tokens as well as by requests. Ten requests with tiny cached prefixes can produce a higher request-hit percentage but less monetary saving than one request reusing a large prefix. The billing calculation follows the token categories and rates, so the reporting metric should make that distinction visible.

Reconcile a price sheet with a usage export

Start with a closed time window and one model/endpoint combination. Sum uncached input, cached reads, cache writes and billed output according to the service's usage fields. Apply the corresponding rates once to each category. Add tools and storage from their own quantities, and keep taxes, credits and contract adjustments separate from list-price consumption.

If the totals disagree, inspect request identifiers and timestamps before applying a blanket adjustment. A client timeout does not establish that the provider performed no work, and a retry can be a separate attempt. Preserve both records when they are reported as billed activity. Do not delete unsuccessful attempts from the estimate merely because the application did not deliver their result.

The final sheet should let another person change one assumption and reproduce the new total. That is more useful than a fixed ranking of cheap models: it continues to work when a provider changes a price, your prompts grow or the application adds a retrieval step.

Which price comparison matters for your application?

For high-volume classification, compare the smallest candidates that meet the saved acceptance criteria. The output may be only a label and a few fields, so input volume and repeated instructions can drive the token budget. Include rejected records and validation calls. A cheaper model that needs a second model to correct routine labels should be priced as a two-stage process, not as an isolated API call.

For a support assistant, measure the retrieved context and conversation history together. A short customer question can arrive with many pages of internal documentation. Compare cost per grounded, accepted answer and identify how often the workflow escalates to a person. A system that saves token costs by omitting required context may simply move work into the support queue.

For a coding assistant, count the work needed to reach an accepted patch. Repository reading, planning, tool results, failed edits and test repair can create several calls for one developer request. Compare both the token invoice and the developer's review time. Keep the same task and test requirements across candidates; an unfinished patch is not a cheaper successful outcome.

For research and long-document analysis, separate document length from output requirements. Some tasks need the entire source, while others can retrieve selected passages. Compare those architectures using the same answer criteria before applying a long-context rate. If retrieval misses a required passage, include the resulting rework or fallback in the comparison.

For applications with regional or contractual constraints, eliminate endpoints that cannot meet those requirements before ranking price. The model developer's direct API, a cloud-hosted version and a third-party host can have different terms, feature availability and billing units. Save the exact service route beside the price. An attractive public rate for an unavailable route cannot reduce your production budget.

Finally, compare a plausible operating range, not one ideal request. Use the saved evaluation to define short, typical and large cases, then weight them by your expected task mix. Recompute that mix after a feature launch or prompt change. This keeps the selected model tied to the application people use, rather than to a price ranking that assumes every request has the same length.

What belongs in a maintainable pricing sheet?

Keep one row per model, host, processing tier and context band. Record the source URL, check date, currency, input, output, cached input and cache-write rates. Track tool charges separately. A model name alone is too ambiguous to reproduce an estimate months later.

Keep workload assumptions in a different section: request count, input distribution, output distribution, cache-hit share, retry share and escalation share. That separation makes it possible to update vendor prices without accidentally changing the workload at the same time. Show at least a typical case and a high-usage case.

Reconcile a small real invoice or usage export with the sheet before relying on it for a large deployment. Investigate differences by category rather than applying an unexplained percentage uplift. Common causes include hidden reasoning usage, growing conversation history, cache writes, tool charges and retries after client timeouts.

For more detail on one provider, see OpenAI API pricing and cost calculations or Amazon Bedrock pricing. For access policies and service selection, use the AI API provider guide. The cheapest suitable endpoint is the one that meets your workload's requirements at the lowest total cost, with assumptions you can inspect and update.

Illustrated portrait of Rome Thorndike

Rome Thorndike

Rome Thorndike is the CEO & Founder of Provyx, which provides GTM intelligence and data validation for healthcare companies, including EngagedMD and BTL Industries. He writes The AI News Digest for over 3,000 subscribers and has worked in Azure AI/ML enterprise sales and AI-company customer delivery.

Connect on LinkedIn