Cost analysis · Evidence checked 20 November 2026

What actually matters in AI inference cost per million tokens?

Cost per million tokens is a derived number, not a sticker price. It moves with the input/output mix, the tokenizer, how much context you resend and how often you retry. This guide shows the arithmetic, the four variables that change it, and the point where a flat plan is the cheaper decision.

Short answer. Calculate your own blended rate: log real input and output tokens per workload, apply the input and output prices separately, add measured retry and re-run overhead, then divide total cost by total tokens. Compare that number with a flat plan using the same workload. A headline rate per million is only useful after the mix, context and retry assumptions are yours.

Key facts

The variables that decide what a million tokens actually costs
Input vs outputOutput tokens are typically priced higher than input tokens
Tokenizer varianceThe same text can produce different token counts across model families
Context resendMulti-turn and RAG workloads resend context on every request
CachingPrompt caching reduces cost when a stable prefix repeats, where the provider documents it
RetriesFailed and retried calls still consume budget on per-token plans
Flat alternativePlugsky self-serve plans are flat monthly with published fair-use limits and no per-token billing
Model tiersCheaper small models handle classification and routing before frontier calls
Product statusChat, streaming, JSON mode, function calling, embeddings and RAG are documented as live

TL;DR

  • Cost per million tokens is not one number — input and output are weighted differently.
  • Resent context and retries are the two costs teams forget to measure.
  • Tokenizers differ, so compare cost per task, not cost per character.
  • Cheap models for routing and classification cut spend before it starts.
  • Flat-rate pricing replaces the per-million maths with a fixed monthly plan.

Why cost per million is a derived number

A provider publishes two rates, input and output, and sometimes more: cache reads, cache writes, batch, long-context tiers, priority processing. Your cost per million is a weighted average of those rates under your traffic. Two teams on the same price list can have blended rates that differ by a factor of three because one sends long prompts and short answers while the other sends short prompts and long answers.

That is why a comparison table of headline rates is a starting point, not an answer. The useful question is not “which model is cheaper per million?” but “which model is cheaper per solved task under my token mix, retry rate and quality bar?” The second question needs your numbers.

How it works, step by step

  1. Instrument your application to log input and output token counts per request.
  2. Separate workload classes: chat, RAG, classification, extraction and agents.
  3. Measure average tokens per request and requests per user per month for each class.
  4. Multiply by the live rates for the models you actually call, then add retry overhead.
  5. Run the same workload through a smaller model and compare quality with an eval set.
  6. Compute the monthly total and compare it with the flat plan that covers your usage.
  7. Re-measure after every prompt or model change — token profiles drift quickly.

Try it yourself

Open the LLM token calculator to run the arithmetic interactively, then read the method below so you know which inputs are assumptions.

The four variables that set your per-million price

Input weighting

Most providers price input and output differently, and output is usually the expensive side. A support bot that reads a long policy document and answers in one sentence has a very different mix from a copywriting tool that reads one line and writes a page.

Tokenizer

The same paragraph can be more tokens on one model family than another, so a lower headline rate can still cost more per task. Code, JSON, Arabic and other non-English text are common places where a character-based estimate drifts badly from the real count.

Context resend

A RAG call that sends a long retrieved passage pays for that passage on every turn. A chat app that resends the full history pays for every earlier message again. Both are invisible in a per-request average and obvious in a monthly bill.

Retries

Timeouts and 429 retries that reach the model are billed work on per-token plans. A retry rate of 8% is an 8% cost increase on the calls it touches, and a retry storm during an incident can be the largest line in the month.

How to calculate your own cost per million tokens

Do not estimate from character counts. Log real usage, then apply this method:

  1. For each workload, record average input tokens and average output tokens per request.
  2. Multiply by monthly request volume to get monthly input and output tokens.
  3. Read the current input and output rates from the live pricing page and apply them separately.
  4. Add retry and re-run overhead as a percentage you measured, not a guess.
  5. Divide total monthly cost by total tokens to get your blended cost per million.

The token calculator runs the same arithmetic interactively. If the total is dominated by stable, predictable traffic, compare it against a flat-rate plan where usage is unlimited under fair use.

A worked example without a price list

Suppose your logs show 8,000 input tokens and 2,000 output tokens per request, 50,000 requests a month, and a 5% retry rate that reaches the model. Monthly input tokens are 400 million before retries; output tokens are 100 million. Add 5% to both. Output is 20% of the token mix, so if your quote prices output at four times input, the blended rate is 0.8 × input rate + 0.2 × (4 × input rate) = 1.6 × the input rate per million tokens. That ratio is the part you can compute without quoting anyone's price; the currency figure comes from your contract.

Run the same arithmetic with a smaller model for the classification share of the traffic. If 40% of requests are classification and a small model handles them at a fraction of the rate, the blended number moves more than a prompt-tuning pass will. Routing is a cost decision before it is a quality decision.

import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["PLUGSKY_API_KEY"],
    base_url="https://api.plugsky.com/v1",
)
RATE_IN = float(os.environ["RATE_IN_PER_MILLION"])
RATE_OUT = float(os.environ["RATE_OUT_PER_MILLION"])

def call(prompt: str):
    response = client.chat.completions.create(
        model="plugsky-plus",
        messages=[{"role": "user", "content": prompt}],
        max_tokens=512,
    )
    usage = response.usage
    cost = (usage.prompt_tokens * RATE_IN + usage.completion_tokens * RATE_OUT) / 1_000_000
    return response.choices[0].message.content, usage, cost

Code examples use https://api.plugsky.com/v1. The docs also show https://plugsky.com/v1 as an alias; keep one host in configuration. The rate variables hold your own quoted rates, not prices published by this page.

Where teams overspend without noticing

  • Full history on every turn. Chat apps resend the whole conversation; trimming or summarising old turns cuts input tokens immediately.
  • Oversized retrieved context. Sending ten chunks when three answer the question is a silent multiplier.
  • Frontier models for easy calls. Routing classification, formatting and extraction to small models changes the blended rate.
  • Uncapped output. A missing max-token setting lets a model ramble at output rates.
  • Re-embedding unchanged documents. Incremental indexing avoids paying twice for the same text.
  • Retrying without a budget. A retry loop that ignores Retry-After turns one failed request into a billable storm.

Latency is a cost too

Cheaper tokens can be more expensive per completed task if users abandon the feature. Measure p95 time to last token at peak, not average latency on an idle system. A slow answer that needs a retry costs twice: once in tokens and once in the support ticket.

Agent workloads amplify every multiplier above. A planner that calls five tools before it answers pays for every tool result on the next turn, and a retry loop can multiply the whole trace. The AI agent cost index covers how tool calls and retries change the total.

The trade-off is usually explicit. A smaller model may answer faster and cost less but fail more often on ambiguous inputs; a frontier model may succeed once where the small model needs three attempts. Cost per solved task captures both, which is why it belongs in the same dashboard as cost per million.

When flat-rate beats per-million maths

Per-token pricing is efficient for low, spiky volume: you pay for exactly what you use. It becomes awkward when volume is steady and forecasting matters, because a prompt change, a new feature or a retry storm moves the bill. Flat monthly plans with published fair-use limits convert that variable line into a fixed one, and there is no per-token charge or overage fee on self-serve plans.

If you are still comparing published rates, the AI API pricing guide explains how list prices are structured and where they mislead. Keep the measurement discipline either way: tokens per task is the metric that tells you whether a quality improvement is worth its cost. The unlimited AI API comparison covers the plan-level fine print, and the pricing page has the current limits.

Honest comparison

This table compares billing models, not providers. The criteria are the ones that change a budget: the billing unit, the output-token premium, how context resend and retries are treated, forecastability and the main optimisation lever. We did not quote any provider's current rates. The per-token and self-hosted columns describe cost structures; they are not a price comparison, and the Plugsky column reflects published plan terms checked on 20 November 2026.

Cost factors compared across flat-rate, per-token and self-hosted inference
Cost factorPlugsky flat-ratePer-token pricingSelf-hosted inference
Billing unitFlat monthly planInput and output tokensGPU hours plus operations
Output-token premiumNone on self-serve plansUsually priced higher than inputDepends on your hardware
Context resendCovered by the plan under fair useBilled on every callConsumes GPU time
RetriesNo per-token charge on self-serveBilled when they reach the modelConsumes GPU time
ForecastabilityFixed monthly line itemVaries with traffic and promptsCapex plus utilisation risk
Optimisation leverRoute models for quality and latencyCompress prompts and contextBatch and quantise

Flat-rate is not automatically cheaper. A plan sized for a launch month sits idle in a quiet one, and self-hosted inference can beat both at very high sustained utilisation. The comparison only becomes honest when the volume and the concurrency requirement are real.

What we did not verify

  • We did not measure token counts for your text. Tokenizer output varies by model family; log the counts your provider returns.
  • We did not quote any provider's current per-token rates. The worked example uses ratios and variable rates, not a price list.
  • We did not test latency, retry behaviour or throughput on a production workload.
  • We did not review a contract for cache, batch or long-context pricing. Those terms change the blended rate and belong in the quote comparison.
  • We did not verify that a flat plan's fair-use limits cover your peak. Check concurrency and RPM against your load test.

Frequently asked questions

Why are output tokens more expensive than input tokens?

Generating text is sequential and compute-heavy, while prompts can be processed in parallel. Most providers therefore weight output tokens higher, which is why uncapped completions inflate bills.

Does streaming change the cost per million tokens?

No. Streaming changes how tokens are delivered, not how many are generated or how they are billed. It improves perceived latency while the token count stays the same.

How do I count tokens accurately?

Use the tokenizer for the model you call rather than estimating from words or characters. Log token counts returned in API responses so your measurements match what is actually billed.

Do retries cost money?

On per-token plans, yes: a retried call that reaches the model is billed again. On Plugsky self-serve plans there is no per-token billing, so retries consume rate-limit budget rather than adding charges.

What is a blended cost per million tokens?

It is your total monthly spend divided by total tokens across all models and workloads. It is the number to compare against flat-rate plans because it reflects your real model mix.

Is flat-rate always cheaper?

No. Flat-rate wins when usage is steady and predictable. Per-token can be cheaper for low, spiky or experimental workloads where a monthly plan would sit idle. Compare with your own measured volumes.

How much does Plugsky cost?

Prices change, so check the live pricing page for current plans. The free plan includes two models and no card is required.

Do embeddings count toward inference cost?

Yes. Embedding calls consume tokens and should be measured separately, especially when re-indexing. Incremental indexing and cached embeddings keep that line small.

Related

Replace the per-token forecast with a fixed line

Compare your blended rate with a flat plan on the same workload.

Start free See pricing

Cite this page

Plugsky (2026). “AI Inference Cost per Million Tokens: What Matters”. Plugsky. Available at: https://plugsky.com/articles/ai-inference-cost-per-million-tokens-what-actually-matters (last updated 20 November 2026).

By Plugsky Research · Last updated 20 November 2026.

Sources

Pricing mechanics were checked on 20 November 2026. This page does not reproduce vendor rates; read them from the source on the day you model a budget.

Last checked 20 November 2026. Product facts live at /facts; plan terms live at /pricing. Legal: Terms and SLA.