The cheapest LLM APIs in 2026: real per-token math
What "cheapest" actually means
When teams look for the cheapest LLM API, they usually mean the lowest cost per million tokens. But the headline number on a pricing page is rarely what you pay. Input and output are priced separately, most providers round up, and gateways often add a margin on top of the vendor's list price. The only honest way to compare is to take each model's published input and output rates, multiply by your actual usage mix, and sum the total.
That is the math we walk through below.
Budget models vs frontier models
The cheapest APIs in 2026 sit in two tiers. Budget open-weight models charge a fraction of what frontier models cost, and for many workloads the quality gap is smaller than the price gap.
GLM 5.2 is one of the least expensive models available through Riven. It lists at $1.40 per 1M input tokens and $4.40 per 1M output tokens. For a chat application that consumes roughly 80% input and 20% output by token volume, the blended rate works out to about $2.00 per 1M tokens:
\[ 0.8 \times \$1.40 + 0.2 \times \$4.40 = \$1.12 + \$0.88 = \$2.00 \]
Kimi K3 sits a step up at $3/1M input and $15/1M output. With the same 80/20 mix:
\[ 0.8 \times \$3 + 0.2 \times \$15 = \$2.40 + \$3.00 = \$5.40 \text{ per 1M tokens} \]
Sonar Reasoning Pro, built for search-augmented reasoning, runs $2/1M input and $8/1M output, giving a blended $3.20 per 1M tokens at the same ratio.
Frontier models from the GPT-5.6 family and the Claude line cost meaningfully more. The point is not that one tier is better than the other. It is that the per-token gap between budget and frontier can be 5x to 10x, and many production tasks — classification, summarization, extraction, routing — do not need a frontier model.
Input vs output pricing
Every commercial LLM API bills input and output separately. Input tokens are the prompt you send. Output tokens are what the model generates. Output is almost always more expensive, often 3x to 5x the input rate, because generation is computationally heavier.
A common mistake is to read only the input price and assume that is the cost. If you send a 4,000-token prompt and get back 500 tokens of output with GLM 5.2, you pay:
\[ 4 \times \frac{\$1.40}{1000} + 0.5 \times \frac{\$4.40}{1000} = \$0.0056 + \$0.0022 = \$0.0078 \]
Less than a cent per request, but the output portion contributes nearly 30% of the cost despite being a fraction of the token count. Applications with long prompts and short responses are input-heavy; applications with short prompts and long completions are output-heavy. Knowing your ratio matters before you pick a model.
A useful exercise is to sample a week of production traffic, sum total input and output tokens separately, and compute the ratio. That single number tells you whether input price or output price should drive your model selection. A team that is 90% input by volume should weight input price heavily; a team generating long structured outputs should weight output price instead.
The markup problem
The vendor list prices above are what the model publishers charge. If you go direct, you pay them. If you go through a gateway or reseller, you may pay more. Some gateways add 10% to 40% on top of list price and bury it in their advertised rate. A model that looks cheapest on the gateway's pricing page may not be cheapest on the invoice.
Riven passes through each vendor's published list price with transparent per-token pricing, synced daily. If GLM 5.2 drops its input price, the Riven price drops the same day. Revenue comes from subscriptions and a flat $3 per 1M tokens platform metering fee on pay-as-you-go, not from inflating per-token rates.
Doing the math for your own workload
The fastest way to get an honest number is to plug your expected monthly input and output token counts into a calculator that compares all models side by side.
Riven's LLM API pricing calculator does this across the full 160+ model catalog. Enter your token volumes, sort by total monthly cost, and the cheapest option for your specific usage appears at the top. No signup required.
Try it
- Estimate your monthly cost across 160+ models with the pricing calculator.
- Browse per-model pricing pages at rivenai.io/models.
- Create a free account at rivenai.io/sign-up and start with 500K tokens per month at no cost.