← Back to Blog

By Shreyas M VPublished 14 min read

AI API Costs Explained: Tokens, Pricing and Keeping Bills Low

LLM API cost explained: how token pricing works, a worked chatbot bill, caching, model choice and a budget method, with prices dated to late 2026.

LLM API cost is the number of tokens you send and receive, multiplied by the model's price per million tokens, with output priced higher than input. A token is a piece of a word, so one request on a small model costs a fraction of a cent and the bill grows with volume. The qualification is that every price below is a list price that moves: on 23 November 2026 PricePerToken said 201 of its 722 tracked models had changed price that month.

  • Maths. Cost = input tokens x input rate + output tokens x output rate, per million tokens, repeated for every request.
  • Model choice. The same chat costs 20 times more on a mid-tier model than on a small one, as the worked example shows.
  • Caching. A cache read costs about a tenth of fresh input on most models, but only when the prompt is built to hit it.
  • Budget. Work out cost per conversation first, then per customer, then set a cap before launch.

How LLM API Pricing Works: Tokens, Input and Output

You pay per token, and input and output are priced separately, quoted per million tokens. CloudZero's guide, with rates verified on 20 August 2026, says a token is roughly three-quarters of an English word. Input is what you send: the instructions, the customer's message and the chat so far. Output is what the model writes back.

Output costs more. CloudZero's August rates put it at 5 times input at Anthropic and 6 times at OpenAI, and CostGoat gives a general range of 2 to 5 times. So long answers, not long prompts, often drive the bill.

Three details catch beginners. The API is stateless, so each request re-sends the whole conversation (Maximem, 30 October 2026). Reasoning models bill their hidden thinking as output, which CloudZero says can push effective costs to 3 to 10 times the base rate.

The third detail is currency. Every source quotes dollars, so budget in dollars and convert at your bank's rate on the day, and ask your accountant how tax applies to a foreign invoice.

Token Maths: A Worked Example for a Business Chatbot

A support chatbot's bill is the tokens in one conversation, priced at the model's rates, times conversations a month. The figures below are my assumptions, not measurements: a 2,000-token system prompt (the business's FAQ and rules), a 50-token customer message and a 150-token reply per turn, over 6 turns, for 3,000 conversations a month.

Because history is re-sent, turn 1 sends 2,050 input tokens and each later turn adds 200. Input over six turns is 2,050 + 2,250 + 2,450 + 2,650 + 2,850 + 3,050 = 15,300 tokens, and output is 6 x 150 = 900.

The rates are Claude Sonnet 5.5 at $2 input, $10 output, $0.10 cache read and $2.50 cache write per million, and Claude Haiku 5.5 at $0.10, $0.50, $0.01 and $0.125. Standard Compute (14 October 2026) and Maximem (30 October 2026) agree on these, and I took the 5-minute cache write from Maximem.

SetupPer conversation3,000 conversations
Sonnet 5.5, no cache$0.0396$118.80
Sonnet 5.5, system prompt cached$0.0216$64.80
Haiku 5.5, no cache$0.00198$5.94
Haiku 5.5, system prompt cached$0.00113$3.39

Sonnet with no cache is 15,300 x $2 / 1,000,000 = $0.0306 in, plus 900 x $10 / 1,000,000 = $0.009 out, so $0.0396. For the cached row, the 2,000-token prompt is written once ($0.005) and read five times (10,000 x $0.10 / 1,000,000 = $0.001), the other 3,300 input tokens cost $0.0066, and output stays $0.009, giving $0.0216.

Two things follow. Caching saved 45% on Sonnet, and afterwards output is about 42% of the bill, so shorter replies now matter. And doubling the conversation to 12 turns sends 37,800 input tokens, not 30,600, so Sonnet's uncached cost rises from $0.0396 to $0.0936, which is 2.4 times.

If this assistant is a feature inside a product you sell, the per-conversation figure becomes a line in your unit economics. Measuring it per customer is a data-model decision, and it is the kind of thing SaaS development settles in the first weeks, not after launch.

LLM API Cost Comparison: Where Prices Sit in November 2026

List prices cluster into a few tiers, with a 100-fold gap between top and bottom. Maximem read each provider's own page on 30 October 2026 and found flagship input from $0.66 to $10 per million, and each provider's cheapest model from $0.03 to $0.25. The table groups its standard-tier rates, in dollars per million tokens.

TierExamplesInputOutput
FlagshipGPT-6 Astra, Claude Fable 5.1$10$50
Upper midClaude Opus 5.5$4$20
MidClaude Sonnet 5.5, GPT-6.1 Sol, Kimi K3.1 Pro$2$10
SmallClaude Haiku 5.5, GPT-6 Luna$0.10$0.50
Small, openDeepSeek flash (off-peak), Mistral Small 4, GPT-OSS 120B$0.15$0.60

For OpenAI and Anthropic, the three-tier ladder is now identical. Google differs: Standard Compute and Maximem list Gemini 3.8 Flash at half price ($0.75 and $3.75) until 31 December 2026, and Gemini 4 Argon at $2 and $10 until 30 November, then $4 and $20 from 1 December. Any Google LLM API cost you budget with therefore changes on 1 December.

Dates matter more than the table. CloudZero says OpenAI cut GPT-5.6 Luna by 80% and Terra by 20% on 30 July 2026, and Anthropic made Sonnet 5's introductory $2 and $10 permanent on 11 August. Maximem found Mistral Large 4 listed at $1.36 on 28 October and $0.70 on 30 October. Store the date beside every rate you budget with, and re-run the sum each quarter.

Model Choice: Cheapest per Token Is Not Cheapest per Task

Model choice is the biggest lever, because the spread inside one provider runs from 10 times at Anthropic to 150 times at OpenAI, per CloudZero's August figures. Its own example, 10,000 conversations a day at 500 tokens in and 300 out, is 150 million input and 90 million output tokens a month. At its 20 August rates, GPT-5.6 Luna ($0.20 and $1.20) costs 150 x $0.20 + 90 x $1.20 = $138 for that traffic, against $3,450 at GPT-5.6 Sol ($5 and $30), a 25-fold gap.

Cheap does not mean right. CloudZero warns that a budget model needing three attempts or human cleanup costs more than a mid-tier model that gets it first time, and says only tests on your own workload decide. The table sets out the starting points the sources give.

TaskStart withAdvice from
Chatbot answersMid tierCostGoat
Classification, extractionCheapest tierCloudZero
Bulk content processingBudget modelCostGoat
Hard reasoningFlagship, if tests show the liftCostGoat, CloudZero

CostGoat, which sells a spend tracker, says routing easy queries to a cheap model and escalating only when needed typically saves 60 to 80%. I found no test behind that range, so treat it as a direction. Build a test set of 50 real customer questions, run each tier, and price the winner.

Prompt Caching: When the 90% Discount Is Real

Prompt caching bills a repeated prompt prefix at a fraction of the input rate, about 10% on most models, but only if the prefix is identical each time. CloudZero lists cache reads at 10% of input on both OpenAI and Anthropic, with Anthropic's cache write at 1.25 times input for 5 minutes or 2 times for an hour. Anthropic's own docs, quoted by CloudZero, say the 5-minute cache pays off after one read and the 1-hour cache after two.

Caching fails quietly. CloudZero warns that reordering a prompt changes the stable prefix, and every token then bills at full price with no alert. Google's page, as Maximem quotes it, promises savings only "if your request hits caches", so treat the cached figure as the best case.

The cache can also decide between models. In Maximem's 40-turn chat (a 2,000-token prompt, 476,000 input and 14,000 output tokens in all), DeepSeek's flash model off-peak costs $0.013 with a warm cache against $0.014 for Haiku 5.5 and GPT-6 Luna, though it lists higher, because its cache read is $0.003 per million against their $0.01. The same open model, GPT-OSS 120B, costs $0.018 on Fireworks, $0.046 on Groq and $0.080 on Together, which lists no cached rate.

Multipliers That Change the Bill Without Warning

Six extras can move a bill away from the rate card, and each appears in the sources. The table lists them with the dates they were read.

MultiplierEffectSource
Long promptsOpenAI GPT-6 and 5.6 above 272K tokens, and Haiku 5.5 above 100K, bill the whole request at a higher rateStandard Compute, 14 Oct
Reasoning tokensBilled as output, 3 to 10 times base costCloudZero, 20 Aug
Regional endpointsOpenAI adds 10%, Anthropic charges 1.1 times for US-onlyStandard Compute, 14 Oct
New tokenizerAbout 30% more tokens for the same text on Claude 4.7 and laterCloudZero, 20 Aug
Peak hoursDeepSeek halves its price off-peakStandard Compute, 14 Oct
Batch jobs50% off for asynchronous workCloudZero, 20 Aug

The tokenizer point also means two providers' per-token prices are not like for like, as llm-prices.com notes. For a Hindi or Kannada assistant, I found no sourced token counts, so measure your own text before you trust any estimate.

The DeepSeek peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, per Autosheet. Adding 5 hours 30 minutes gives 06:30 to 09:30 and 11:30 to 15:30 in India, so, if those hours still hold, an overnight batch job in India runs at the lower rate.

Free and Low Cost LLM API Options

Free LLM APIs exist, but CloudZero calls them a trailhead, not a destination: fine for evaluation and wrong for production. It says OpenAI and Anthropic give small, expiring trial credits, Google offers a free tier through AI Studio for development, and aggregators give free access to small models with rate limits.

The risk is the silent switch. CloudZero says no invoice announces that free credits ended, and the spend simply starts. It describes one customer whose OpenAI spend had reached 25% of cloud spend before anyone saw it.

For low cost LLM API use at production scale, the sources point to small models in the table above. CostGoat says DeepSeek's open models price output far below the OpenAI flagships, at lower benchmark quality, though it says the gap has narrowed, and Maximem's table shows the same pattern. CostGoat also warns to check each provider's data policy before sending sensitive customer data.

Budgeting an AI Feature: From Cost per Conversation to Plan Price

Budget in three numbers: cost per task, tasks per customer, and a cap. Take a fictional appointment SaaS with 40 clinic customers, each handling 300 assistant conversations a month. That is 40 x 300 = 12,000 conversations, and at the cached Sonnet figure of $0.0216 it costs 12,000 x $0.0216 = $259.20 a month, or $6.48 per clinic.

Decide your ceiling before you price. If model cost may be at most one fifth of the plan price (my assumption, not a rule), the plan must be at least $6.48 x 5 = $32.40 a month for that usage. Then stress it: double the conversations costs double, and longer chats cost more than double.

  1. Measure. Log the token counts each response reports, with the customer's ID, so cost per customer is a sum, not a guess.
  2. Price. Apply the formula with dated rates, and add reasoning tokens and retries.
  3. Cap. Set a billing limit and usage alert in the provider's dashboard, as Autosheet says OpenAI allows.
  4. Own it. CloudZero's rule: the day a key touches production traffic, its spend gets an owner, a forecast and a dashboard.
  5. Review. Re-run the sum after every price move.

API Tokens, a Fixed Monthly Plan or Your Own Server

Pay per token while volume is low or uneven, and consider a fixed arrangement only when spend is steady and you must promise a margin. Standard Compute, a vendor, sells one key at a fixed monthly price, for example $89 with an $89 compute budget, drawn at each model's per-token rate and stopped with an HTTP 402 error at the cap. My reading is that this buys predictability and a hard ceiling, not cheaper tokens.

Your own server swaps a usage bill for fixed costs and someone's time. BenchLM offers a calculator that models the break-even against API cost at a chosen monthly volume, defaulting to 100 million tokens, but I have no sourced hardware figures to put in it. Get written quotes for hardware and support before you compare.

What Usually Goes Wrong With LLM API Bills

Most surprises come from things the rate card does not show. The table collects the ones the sources name, with cause and fix.

MistakeCauseFix
Free credits run outSilent switch to metered billingSet a limit and alert on day one
Cache stops hittingPrompt reorderedKeep the stable prefix first, watch cache reads
Stale price tableRates movedDate every rate, re-check quarterly
Long chats balloonHistory re-sent each turnCap turns, trim or summarise history
Wordy repliesOutput costs 5 to 6 times inputAsk for short answers
One model for everythingNo routingTest cheaper tiers per task

What is documented and what is my reading:

  • Documented, as reported by the sources below: every list price, date, multiplier and cache rule. I did not read the providers' pricing pages myself.
  • My reading: the worked examples, the one-fifth ceiling, the fixed-plan reading and the 50-question test.

What to Do Next

Price one real task this week: count its tokens, apply a dated rate, and write the monthly figure and the cap in a sheet. If you compare models, start with the ChatGPT, Claude and Gemini comparison for small businesses, whose API example used July 2026 prices, and recheck them against the table above. If the assistant will answer customers on WhatsApp, WhatsApp AI chatbots for Indian businesses covers the platform's own costs and rules, which are separate from model usage.

If the AI feature is part of a product you are building, Elyx's SaaS development work covers data models, billing, and admin and analytics dashboards. Engagements start from ₹9,999, and every project is quoted to your requirements, in writing, after a call, so request a quote. See Elyx pricing for how quotes work.

Sources

Frequently asked questions

What is an LLM API?

An LLM API is a service that lets your software send text to a large language model and receive text back, billed by the token. Providers such as OpenAI, Anthropic and Google sell it, and CostGoat describes it as access over HTTP requests.

How much does an LLM API cost?

It depends on the model and the volume: on 30 October 2026, Maximem found flagship input at $0.66 to $10 per million tokens and output at $1.98 to $50. A short chat on a small model costs a fraction of a cent, as the worked example above shows.

What is the cheapest LLM API?

On 30 October 2026, Maximem found Alibaba's Qwen3.7-Flash lowest at $0.03 input and $0.13 output per million, for requests up to 32,000 tokens. Among the main US providers, Claude Haiku 5.5 and GPT-6 Luna list at $0.10 and $0.50, and CloudZero warns that cheapest per token is not cheapest per task.

Which LLM API is free?

Free access exists for testing, not production: CloudZero says Google gives a free tier through AI Studio for development, and OpenAI and Anthropic give small expiring trial credits. Free models on aggregators carry rate limits. Use them to test, then set a budget before real traffic.

What is a token, and how many words is it?

A token is a piece of text the model reads or writes, and CloudZero puts it at roughly three-quarters of an English word. Autosheet adds that it can be a word, part of a word or a punctuation mark.

Does prompt caching really cut the bill by 90%?

It cuts the cost of the cached part by up to 90%, not the whole bill. In the worked example above, caching only the system prompt saved 45% on Sonnet 5.5, because output and new input are still full price.

How do I track LLM API cost per user?

Record the token counts each response reports, tag them with the customer's ID, and multiply by the dated rates. Check your provider's documentation for the exact fields, and add a monthly alert.

How often do LLM API prices change?

Often: PricePerToken said on 23 November 2026 that 201 of its 722 tracked models changed price in November. Date every rate you use and re-check before each budget review.

Does an Elyx quote include AI model usage?

No. Elyx's AI chatbot page says model usage is billed by the provider you choose, separately from the build, so ask any studio to quote the two apart.

AI for Business
Let's build

Have something worth building?

Tell us where you're headed. We'll bring the team, the plan and the craft to get you there.