← Blog

What Is LLM Cost? A Plain-English Breakdown

2026-09-18 · 5 min read · SubToAPI Team

What Is LLM Cost?

LLM cost is the price you pay to send requests to a large language model and receive responses back. It's not a flat subscription fee like most SaaS tools — it's usage-based, meaning your bill grows or shrinks depending on how much text you send in and how much the model generates out. The core unit of measurement is the token, a small chunk of text (roughly 4 characters or three-quarters of a word in English).

In practical terms, LLM cost is a function of three things: how many tokens go into the request (your prompt, context, and any documents you include), how many tokens come out (the model's response), and which model you're calling. A frontier model with a large context window costs more per token than a smaller, faster one. Understanding LLM cost means understanding these variables well enough to predict and control your bill before it surprises you.

How LLM Pricing Actually Works

Most LLM providers charge per million tokens, split into two separate rates:

Output tokens are almost always priced higher than input tokens, sometimes 3–5x more, because generating text is computationally heavier than reading it. This matters more than most people expect: a chatbot that gives short answers to long questions has a very different cost profile than one that writes long essays from short prompts.

A rough example of how the math works:

Input:  2,000 tokens  × $3.00  / 1,000,000 = $0.006
Output: 800 tokens    × $15.00 / 1,000,000 = $0.012
Total per request: $0.018

That looks trivial until you multiply it by thousands of requests per day, multi-turn conversations that resend the full history each time, or tool-calling loops that make several model calls per user action. LLM cost rarely shows up as one big number — it accumulates from many small ones.

What Actually Drives Your LLM Bill

Context length

Every time you send a message, you typically resend the full conversation history so the model has context. A 20-turn conversation isn't 20x the cost of one turn — it's closer to 1+2+3...+20, because each turn re-sends everything before it. This is one of the most underestimated cost drivers in chat applications.

Model choice

Larger, more capable models cost more per token than smaller ones. Many teams overpay by defaulting to the most powerful model for every task, including ones a cheaper model handles just as well — simple classification, formatting, or extraction tasks rarely need frontier-level reasoning.

System prompts and tool definitions

If you're using tool calling, the definitions of every available tool are sent as input tokens on every single request, even if the model doesn't use them. A large tool schema can quietly become one of your biggest cost line items. See /docs/tools for how tool definitions factor into request payloads.

Streaming vs. non-streaming

Streaming doesn't change the token count or the price — you pay the same either way. What it changes is user-perceived latency, since tokens arrive incrementally instead of all at once after generation finishes. See /docs/streaming for details.

Retries and errors

Failed requests that get retried, or malformed outputs that trigger a second call to fix them, double the cost of that interaction without doubling the value delivered.

LLM Cost vs. Infrastructure Cost

It's worth separating two different kinds of cost that often get conflated:

  1. Model usage cost — what you pay per token to the model provider.
  2. Access and infrastructure cost — what it costs to actually integrate, secure, monitor, and manage that access across a team or product.

The second category is often invisible until it isn't. Sharing one account's session across an app, rotating credentials manually, tracking who used how much, and building basic usage dashboards all take engineering time. This is the gap SubToAPI fills: it turns an existing Claude subscription into a proper HTTPS API with application-scoped keys (sub_live_...), streaming, tool use, and usage metadata built in, so the "infrastructure cost" of exposing LLM access to your app or team doesn't have to be built from scratch. Plans start at €9/month for solo use, with team seats from €19 and scale pricing from €49 — see /pricing for the breakdown, and /docs/quickstart to get a key running in minutes.

How to Estimate LLM Cost Before You Build

A simple exercise most teams skip: before writing code, estimate your monthly token volume.

Daily requests × avg input tokens × input price
+ Daily requests × avg output tokens × output price
× 30 days
= Rough monthly cost

Run this with realistic numbers, not best-case ones. Include conversation history growth if you're building chat, and include tool schema size if you're using function calling. This back-of-envelope math catches architecture mistakes — like resending full history unnecessarily — before they become a surprise invoice.

Making a Basic Cost Call with an API Key

Once you know your rough budget, testing actual usage is straightforward:

curl https://api.subtoapi.app/v1/messages \
  -H "Authorization: Bearer $SUBTOAPI_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "claude-sonnet-4",
    "max_tokens": 500,
    "messages": [
      {"role": "user", "content": "Summarize this in 3 bullet points: ..."}
    ]
  }'

The response includes usage metadata showing input and output token counts, which is what you'd multiply against your provider's pricing to see the real cost of that call. See /docs/messages for the full request and response shape.

Questions

Is LLM cost the same as API cost? Mostly yes — "LLM cost" usually refers to the per-token price of calling a language model through an API, which is the dominant cost for most AI features. It doesn't include separate infrastructure, hosting, or engineering time to integrate that API.

Why does output cost more than input? Generating new text token-by-token requires more computation per token than reading and encoding existing text, so providers typically price output tokens at 3–5x the input rate.

Can I estimate LLM cost before launching a product? Yes — estimate average input and output tokens per request, multiply by expected daily volume and provider pricing, then multiply by 30 for a monthly figure. Test with real prompts, since token counts are hard to guess accurately from character counts alone.

Turn your Claude access into an HTTPS API

SubToAPI gives you application API keys, streaming, tool use and usage insights on top of your existing Claude access — set up in minutes.

Start free  Read the quickstart →