Last verified: July 21, 2026
Short path: Full cross-provider table on AI API pricing. Cheap migration playbook: cheap OpenAI API production guide.
GPT API pricing in 2026 is expressed in dollars per million tokens for input and output separately. Finance teams often budget from a single headline rate and are surprised when agent workloads bill 3× the forecast — because output tokens cost more per token and agents generate many output tokens across multiple hops.
This guide explains how OpenAI-style tier naming maps to LumeAPI catalog rates, walks through monthly budget math with real scenarios, and shows how to estimate cost in Python before you ship a feature.
LumeAPI is an independent OpenAI-compatible gateway — not OpenAI, not an official reseller. Rates below reflect LumeAPI model pages on July 21, 2026.
Quick Answer — GPT tiers (per 1M tokens)
| Model ID | Official ref. in/out | LumeAPI catalog in/out | Typical workload |
|---|---|---|---|
gpt-5.4-mini | $0.75 / $4.50 | $0.225 / $1.35 | Support bots, classifiers, bulk chat |
gpt-5.6-terra | $2.50 / $15.00 | $0.75 / $4.50 | Copilots, balanced quality |
gpt-5.6-sol | $5.00 / $30.00 | $1.50 / $9.00 | Hard reasoning, escalation only |
LumeAPI catalog rates are roughly 70% below the reference columns shown on model pages. Verify live GPT API before contracts.
Rule of thumb: If output is >25% of total tokens, output rate drives the bill. If you run agents, measure cost per completed task, not $/1M in isolation.
How GPT API pricing is structured
OpenAI and OpenAI-compatible gateways bill two counters:
- Input tokens — everything you send: system prompt, history, tool results, attachments (after tokenization).
- Output tokens — everything the model generates, including hidden reasoning tokens if the model emits them.
There is no single “GPT API price.” You pay:
request_cost = (input_tokens / 1_000_000) × input_rate
+ (output_tokens / 1_000_000) × output_rateMonthly roll-up:
monthly_cost = Σ request_cost over all requestsStreaming does not change per-token rates — you still pay for tokens generated, whether they arrive in one JSON blob or over SSE.
What is not in the per-million rate
| Item | Billing note |
|---|---|
| Failed requests before generation | Often $0 output; input may still count if processed |
| Retries after 429 | Duplicate billable calls if the model ran |
| Tool call JSON in output | Counts as output tokens |
| Long system prompts every hop | Input multiplies in agent loops |
For retry discipline see OpenAI API 429 guide.
Official reference vs LumeAPI catalog (July 2026)
| Model | Ref. input | Ref. output | LumeAPI input | LumeAPI output | Savings vs ref. |
|---|---|---|---|---|---|
| gpt-5.4-mini | $0.75 | $4.50 | $0.225 | $1.35 | ~70% |
| gpt-5.6-terra | $2.50 | $15.00 | $0.75 | $4.50 | ~70% |
| gpt-5.6-sol | $5.00 | $30.00 | $1.50 | $9.00 | ~70% |
“Official reference” here means the comparison rate displayed alongside LumeAPI catalog on model pages. OpenAI list pricing and promotions change — re-check before enterprise procurement.
Cross-provider context: LLM API pricing comparison 2026 and cheapest LLM API.
Monthly budget scenarios (LumeAPI catalog)
Assume token volumes are monthly totals across all users.
Scenario A — Support bot (high volume, short answers)
- 200M input + 40M output on gpt-5.4-mini
(200 × $0.225) + (40 × $1.35) = $45 + $54 = $99/monthSame tokens at reference mini rates: ~$330/month.
Scenario B — Copilot (balanced)
- 80M input + 25M output on gpt-5.6-terra
(80 × $0.75) + (25 × $4.50) = $60 + $112.50 = $172.50/monthScenario C — Agent with escalation
- 70% of calls: 60M in + 12M out on mini → $15.48 + $16.20 = $31.68
- 30% of calls: 30M in + 15M out on Terra → $22.50 + $67.50 = $90
- Blended ≈ $121.68/month (vs Terra-only on same tokens ≈ $172.50)
Routing saves more than haggling over a single tier — see route GPT/Claude/Gemini.
Scenario D — Misconfigured “Sol everywhere”
- 50M input + 15M output on gpt-5.6-sol
(50 × $1.50) + (15 × $9.00) = $75 + $135 = $210/monthSame shape on mini: ~$65/month. Default model choice is a pricing decision.
Workload presets — which GPT tier to budget
| Product pattern | Suggested model | Budget assumption | Watch out for |
|---|---|---|---|
| Ticket summarizer | gpt-5.4-mini | Low output cap | Long ticket bodies inflate input |
| In-app copilot | gpt-5.6-terra | Moderate output | Full chat history every turn |
| Code review agent | mini → Terra escalation | 2–4 calls per task | Sol on every file read |
| RAG Q&A | mini or gemini-3-flash | Chunk size drives input | Dumping 20 chunks per query |
| Batch enrichment | mini + batch API where eligible | 50% off async | Not all gateways expose batch |
Python cost estimator (production-ready)
from dataclasses import dataclass
@dataclass(frozen=True)
class ModelRates:
input_per_m: float # $ per 1M input tokens
output_per_m: float # $ per 1M output tokens
CATALOG = {
"gpt-5.4-mini": ModelRates(0.225, 1.35),
"gpt-5.6-terra": ModelRates(0.75, 4.50),
"gpt-5.6-sol": ModelRates(1.50, 9.00),
}
def estimate_cost(
input_tokens: int,
output_tokens: int,
model: str,
) -> float:
rates = CATALOG[model]
return (
(input_tokens / 1_000_000) * rates.input_per_m
+ (output_tokens / 1_000_000) * rates.output_per_m
)
def monthly_from_usage(rows: list[dict]) -> float:
"""rows: [{model, input_tokens, output_tokens}, ...]"""
return sum(
estimate_cost(r["input_tokens"], r["output_tokens"], r["model"])
for r in rows
)
# Example: 50M in + 15M out on Terra
print(f"${estimate_cost(50_000_000, 15_000_000, 'gpt-5.6-terra'):.2f}")
# 105.00Pipe real numbers from Usage CSV exports into monthly_from_usage weekly. Discrepancies usually mean logging gaps or retries.
Reducing GPT API pricing impact (ranked)
- Tier routing — mini for 70–90% of calls; Terra/Sol only on eval failure or explicit user tier.
- Cap
max_tokensper API route — streaming copilots often over-generate without caps. - Trim context — summarize turns older than N messages instead of resending full transcripts.
- Prompt caching — on official OpenAI when cache-hit rate is high; compare task cost, not input rate alone.
- Batch async jobs — ~50% off when latency tolerance is hours, not seconds.
- Gateway catalog — LumeAPI realtime rates for supported GPT ids (this guide’s tables).
- Fix 429 retry storms — duplicate calls look like “usage growth” — 429 guide.
Agent-specific: AI agent API bills out of control.
When official OpenAI pricing beats a gateway
| Situation | Why official may win |
|---|---|
| Very high prompt-cache hit rate | Cached input discounts on repeated system prompts |
| Batch-only workloads | Native Batch API pricing |
| Enterprise commit + credits | Negotiated effective rate |
| Features not exposed via third parties | Vendor-only betas or admin APIs |
Run a two-week shadow: same prompts, compare completed-task cost and error rate on cheap OpenAI API vs direct.
Production checklist
- [ ] Document default model per API surface (not “whatever dev picked”).
- [ ] Set
max_tokensdefaults in server config, not client-only. - [ ] Export Usage weekly; reconcile to finance forecast.
- [ ] Alert when daily spend > 2× trailing 7-day average.
- [ ] Load-test worst-case prompt (longest allowed input) before launch.
- [ ] Log
model,input_tokens,output_tokens,latency_msper request. - [ ] Re-read live GPT API rates each quarter.
FAQ
Is gpt-5.4-mini always the cheapest GPT option?
Among GPT tiers on LumeAPI in July 2026, yes for standard chat. Cross-provider, Gemini 3 Flash may be cheaper for some workloads — compare on your eval set.
Why is my bill higher than the formula suggests?
Common causes: agent loops, retries, oversized history, wrong default model, or tool outputs counted as completion tokens. Measure per-feature usage first.
Do input and output tokenize the same way?
Tokenizers differ by model family. Budget with measured usage from API responses (usage.prompt_tokens, usage.completion_tokens), not character÷4 guesses.
How does GPT pricing relate to “cheapest LLM API”?
Cheapest LLM API 2026 picks across GPT, Claude, and Gemini. This page is GPT-only depth.
Does streaming cost more?
No extra per-token fee for stream: true. You pay for tokens generated. See Node.js streaming guide.
Can I mix GPT tiers on one LumeAPI key?
Yes. Change model per request — multi-model Python.
Sources and verification
- GPT API, models, AI API pricing — July 21, 2026.
- OpenAI Python SDK for
usagefields on completions. - Related: GPT Python example, cheap OpenAI production guide.