What is the cheapest LLM API in 2026?
On Inference.net, the cheapest LLM API endpoints start at $0.027 per 1M input tokens for small classification models (llama-3.2-1b-instruct) and $0.03 input / $0.15 output per 1M tokens for dedicated HTML-to-JSON extraction (inference-net/schematron-v2-turbo). For 1M-context coding agents with tool calling and vision, deepseek-v4.1-flash-1017 costs $0.08 fresh input, $0.007 cached input reads, and $0.635 output per 1M tokens with 0% markup pay-as-you-go billing and default Zero Data Retention.
Headline input pricing alone rarely picks the cheapest API for production traffic. In multi-turn coding agents, 80% to 90% of input tokens are repeated context, so cached read rates and output token rates decide the real monthly invoice.
Live verified per-1M-token pricing (2026-12-06)
Every model ID, context limit, and per-1M-token rate below was verified directly from GET https://api.inference.net/v1/models on 2026-12-06 (the API returns per-token prices; multiply by 1,000,000 for per-1M rates):
| Model ID | Context | Max output | Fresh input ($/1M) | Cached read ($/1M) | Output ($/1M) | Tool calling | Best workload |
|---|---|---|---|---|---|---|---|
llama-3.2-1b-instruct | 60,000 | 60,000 | $0.027 | N/A | $0.201 | No | Simple tagging and routing |
inference-net/schematron-v2-turbo | 128,000 | 8,192 | $0.03 | $0.03 | $0.15 | No | High-volume HTML and JSON extraction |
gemma-3-4b-it | 131,072 | 8,192 | $0.05 | N/A | $0.10 | No | Lightweight text and image classification |
inference-net/schematron-v2-small | 128,000 | 4,096 | $0.05 | $0.05 | $0.23 | No | Complex schema-strict extraction |
deepseek-v4.1-flash-1017 | 1,040,000 | 393,216 | $0.08 | $0.007 | $0.635 | Yes | Coding agents, RAG, and vision |
glm-5.3 | 1,048,576 | 943,718 | $0.084 | $0.079 | $3.00 | Yes | Deep reasoning and long-output synthesis |
minimax-m3.1-flash | 1,000,000 | 524,288 | $0.10 | $0.005 | $0.50 | Yes | Ultra-low-cost coding loops and chat |
glm-5.3-flash | 1,048,576 | 262,144 | $0.10 | $0.03 | $0.35 | Yes | Output-heavy text, image, and video |
nemotron-3-super | 262,144 | 262,144 | $0.102 | N/A | $0.48 | Yes | General tool-calling pipelines |
moonshotai/kimi-k3 | 1,048,576 | 1,048,576 | $0.245 | $0.224 | $15.00 | Yes | Input-heavy synthesis with 1M output ceiling |
deepseek-v4.1-flash-1017-cyber | 1,040,000 | 393,216 | $0.30 | $0.007 | $1.00 | Yes | Authorized AppSec and pentesting (Privileged Access) |
moonshotai/kimi-k3.1-pro | 1,048,576 | 1,048,576 | $1.80 | $0.198 | $9.00 | Yes | Frontier open-weight agentic architecture |
All models above accept OpenAI /v1/chat/completions, /v1/responses, and native Anthropic /v1/messages with one API key. Browse the full model catalog or inspect DeepSeek API pricing for every DeepSeek snapshot.
Why cheapest input price does not equal cheapest monthly bill
Three pricing traps invert the rankings once real traffic hits production:
- Cached read discounts dominate multi-turn agents.
deepseek-v4.1-flash-1017discounts cached reads by 91.3% ($0.08down to$0.007/1M), andminimax-m3.1-flashdiscounts cached reads by 95.0% ($0.10down to$0.005/1M). A model with cheap uncached input and minimal caching discount can cost more by turn five. - Output token pricing carries the bill when caching works. Once 85% of input tokens hit cache, output tokens often represent 50% to 75% of total spend. For example,
glm-5.3has a very low$0.084/1Mfresh input rate, but its$3.00/1Moutput rate makes it 4.6x pricier per coding-agent session thandeepseek-v4.1-flash-1017. - Output-heavy vs. input-heavy ratios flip model pairs.
moonshotai/kimi-k3($0.245fresh input,$15.00output) is cheaper thanmoonshotai/kimi-k3.1-pro($1.80fresh input,$0.198cached,$9.00output) on single-turn, input-heavy summarization. On long multi-turn coding sessions with 85% cache hits,moonshotai/kimi-k3.1-proactually costs less per session because its cached read and output rates are lower.
Workload 1: 40-turn coding-agent session math
This calculation uses the exact shape of our Coding Agent preset: 40 turns per session, 14,000 average input tokens per turn (560K total input: 84K fresh + 476K cached at an 85% cache hit rate), and 900 average output tokens per turn (36K total output). The rightmost column scales that workload to 750,000 requests/month (18,750 sessions: 1,575M fresh input, 8,925M cached reads, and 675M output tokens).
| Model ID | Fresh input (84K) | Cached read (476K) | Output (36K) | Cost per 40-turn session | Monthly (750K reqs) |
|---|---|---|---|---|---|
minimax-m3.1-flash | $0.0084 | $0.0024 | $0.0180 | $0.0288 | $539.63 |
deepseek-v4.1-flash-1017 | $0.0067 | $0.0033 | $0.0229 | $0.0329 | $617.10 |
glm-5.3-flash | $0.0084 | $0.0143 | $0.0126 | $0.0353 | $661.50 |
deepseek-v4.1-flash-1017-cyber | $0.0252 | $0.0033 | $0.0360 | $0.0645 | $1,209.98 |
glm-5.3 | $0.0071 | $0.0376 | $0.1080 | $0.1527 | $2,862.38 |
moonshotai/kimi-k3.1-pro | $0.1512 | $0.0942 | $0.3240 | $0.5694 | $10,677.15 |
moonshotai/kimi-k3 | $0.0206 | $0.1066 | $0.5400 | $0.6672 | $12,510.08 |
claude-sonnet-4-6 (reference) | $0.2520 | $0.1428 | $0.5400 | $0.9348 | $17,527.50 |
Key takeaways from the coding-agent math:
- Under four cents per 40-turn session:
minimax-m3.1-flash($0.0288),deepseek-v4.1-flash-1017($0.0329), andglm-5.3-flash($0.0353) run 26x to 32x cheaper thanclaude-sonnet-4-6($0.9348). - Caching cuts DeepSeek session cost in half: Without prompt caching, that same 40-turn session on
deepseek-v4.1-flash-1017rises from$0.0329to$0.0677(2.06x higher). Ondeepseek-v4.1-flash-1017-cyber, caching cuts session cost by 3.16x ($0.0645vs$0.2040). - Interactive modeling: Adjust turn count, cache hit rate, and monthly request volume in the LLM Pricing Calculator (Coding Agent preset) or isolate prefix-cache savings in the Prompt Cache Calculator.
Workload 2: High-volume HTML and JSON extraction math
Structured extraction pipelines process many short documents with a repeated system prompt and JSON schema. Here is the cost for 100,000 documents with 3,500 input tokens per document (60% shared prompt/schema = 140M fresh input + 210M cached reads) and 350 output tokens per document (35M output):
| Model ID | Fresh input (140M) | Cached read (210M) | Output (35M) | Total for 100K docs | Cost per 1,000 docs |
|---|---|---|---|---|---|
inference-net/schematron-v2-turbo | $4.20 | $6.30 | $5.25 | $15.75 | $0.16 |
inference-net/schematron-v2-small | $7.00 | $10.50 | $8.05 | $25.55 | $0.26 |
glm-5.3-flash | $14.00 | $6.30 | $12.25 | $32.55 | $0.33 |
minimax-m3.1-flash | $14.00 | $1.05 | $17.50 | $32.55 | $0.33 |
deepseek-v4.1-flash-1017 | $11.20 | $1.47 | $22.23 | $34.90 | $0.35 |
Even though inference-net/schematron-v2-turbo bills cached and fresh input at the same $0.03/1M rate, its ultra-low base input and $0.15/1M output rate make it the cheapest option by more than 2x for pure text/HTML-to-JSON extraction. Switch to glm-5.3-flash or deepseek-v4.1-flash-1017 when extraction also requires image inputs or tool calling (see Schematron docs and Structured outputs).
How to keep effective API costs low in production
- Match prompt caching rules to each model family:
deepseek-v4.1-flash-1017anddeepseek-v4.1-flash-1017-cyber: Automatic prefix caching. Omitprompt_cache_keyand keep everything before the changing user turn byte-identical.glm-5.3andglm-5.3-flash: Pass a stableprompt_cache_keyper conversation or shared system prefix alongside byte-identical leading messages.moonshotai/kimi-k3andmoonshotai/kimi-k3.1-pro: Automatic implicit prefix caching on stable leading prefixes.
- Disable reasoning on deterministic ETL tasks:
deepseek-v4.1-flash-1017thinks by default, and thinking tokens bill at the output rate. For classification or JSON extraction where reasoning adds cost without accuracy gain, pass"reasoning_effort": "none"(see Reasoning docs). - Route by task tier on one API key: Send scraping and JSON parsing to
inference-net/schematron-v2-turbo, daily coding loops todeepseek-v4.1-flash-1017, and complex architectural refactors toglm-5.3ormoonshotai/kimi-k3.1-pro. - Use direct serverless providers to avoid aggregator fees: Calling direct GPU hosts avoids marketplace credit fees and keeps prefix-cache stickiness high across turns (see Inference.net vs OpenRouter and Provider comparisons).
Copy-paste Python example with live cost accounting
Create an API key in API keys (or register here) and run this script to measure cached tokens and exact request cost:
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.inference.net/v1", # or https://us.api.inference.net/v1
api_key=os.environ["INFERENCE_API_KEY"],
)
MODEL = "deepseek-v4.1-flash-1017"
RATES_PER_1M = {"input": 0.08, "cached": 0.007, "output": 0.635}
stream = client.chat.completions.create(
model=MODEL,
stream=True,
stream_options={"include_usage": True},
messages=[
{"role": "system", "content": "You are a concise systems engineer."},
{"role": "user", "content": "Write a Go token-bucket rate limiter in 30 lines."},
],
)
for chunk in stream:
if chunk.choices and chunk.choices[0].delta.content:
print(chunk.choices[0].delta.content, end="", flush=True)
if chunk.usage:
prompt_tokens = chunk.usage.prompt_tokens
cached_tokens = getattr(chunk.usage.prompt_tokens_details, "cached_tokens", 0) or 0
fresh_tokens = max(0, prompt_tokens - cached_tokens)
output_tokens = chunk.usage.completion_tokens
cost_usd = (
fresh_tokens * RATES_PER_1M["input"]
+ cached_tokens * RATES_PER_1M["cached"]
+ output_tokens * RATES_PER_1M["output"]
) / 1_000_000
print(f"\n[cost] fresh={fresh_tokens} cached={cached_tokens} out={output_tokens} usd=${cost_usd:.6f}")Related pricing calculators, comparisons, and guides
- Interactive tools: LLM Pricing Calculator (Coding Agent preset) · Prompt Cache Calculator · Live Benchmarks
- Provider and model comparisons: All Comparisons · Inference.net vs OpenRouter · Inference.net vs DeepInfra · Inference.net vs Together AI · Inference.net vs Fireworks AI
- Next guides: Best Open-Source LLMs in 2026 · DeepSeek API Pricing · OpenRouter Alternatives
Start calling DeepSeek V4.1 Flash at $0.08/1M input
Create a free Inference.net API key to run DeepSeek V4.1 Flash, Schematron V2 Turbo, GLM 5.3, and Kimi K3 with 0% markup pay-as-you-go billing and default Zero Data Retention.
Create API key