API Guide

GPT-5 API: Pricing, Keys & How to Call It

The GPT-5 API spans the widest price range of any single family — from GPT-5 nano at $0.05/$0.40 to GPT-5.4 Pro at $30/$180 per million tokens, a 450× spread on output. Most teams don't need the top of that range. This guide gives you the full verified price table across the family (5.5, 5.4, base, mini, nano, Codex), how to get an OpenAI key, and how to call it — directly or through a gateway alongside 300+ other models.

GPT-5 API pricing and access guide — 5.5, 5.4, mini, nano token prices

What the GPT-5 API is

The GPT-5 API is OpenAI's access to its current family — from the tiny, ultra-cheap nano and mini tiers, through the capable base GPT-5, to the frontier GPT-5.4 and GPT-5.5, plus Codex variants for coding agents and the heavy GPT-5.4 Pro reasoning tier. It's the deepest tier ladder of any provider, and the GPT-5 API is the native OpenAI chat-completions format that every other "OpenAI-compatible" provider mimics.

How this is sourced. Prices are from OpenAI and the live DataLLM Lab catalog, June 2026. For the newest tier specifically, see the GPT-5.5 review.

GPT-5 API pricing

ModelInputOutputBest for
GPT-5.5$5$30Agentic, terminal
GPT-5.4$2.50$15Frontier value
GPT-5.3-Codex$1.75$14Coding agents
GPT-5 (base)$1.25$10Capable mid-tier
GPT-5 mini$0.25$2Cheap, high-volume
GPT-5 nano$0.05$0.40Cheapest, simple tasks
GPT-5.4 Pro$30$180Max reasoning

Per 1M tokens, USD, June 2026. Cached input and the Batch API add further discounts. The family spans a 450× output-price range.

The GPT-5 family by price

Excluding the specialist Pro tier, the everyday GPT-5 ladder still spans 75× on output — so picking the right rung is the biggest cost decision you'll make:

GPT-5 output price per 1M tokens, by tierJune 2026 · excludes the $180 Pro tierGPT-5.5$30GPT-5.4$15GPT-5 (base)$10GPT-5 mini$2GPT-5 nano$0.40
Chart: DataLLM Lab — GPT-5 output price per 1M tokens by tier (excluding the $180 Pro tier), June 2026. Most production traffic belongs on mini/base, not the frontier tiers.

How to get an OpenAI API key

  1. Sign up at platform.openai.com and verify your account.
  2. Add billing; some new accounts get limited trial credit.
  3. Create a key under API keys, copy it once, and store it as export OPENAI_API_KEY=...

How to call the GPT-5 API

The GPT-5 API is the native OpenAI format — the OpenAI SDK works with no base-URL change:

from openai import OpenAI

client = OpenAI(api_key="$OPENAI_API_KEY")    # default base_url = api.openai.com

resp = client.chat.completions.create(
    model="gpt-5.4",                   # or gpt-5.5, gpt-5, gpt-5-mini, gpt-5-nano
    messages=[{"role": "user", "content": "Plan and execute this multi-step task..."}],
)
print(resp.choices[0].message.content)

To reach GPT-5 plus Claude, Gemini and others with the same key, change only the base_url to a gateway (below).

Which GPT-5 model to use

5.5 / 5.4 Frontier

  • GPT-5.5 for agentic/terminal work; GPT-5.4 for frontier value at half the price. See the GPT-5.5 review.

Base / Codex Workhorses

  • Base GPT-5 ($1.25/$10) is a strong mid-tier; Codex variants ($1.75/$14) target coding agents.

mini / nano Cheap & fast

  • mini ($0.25/$2) and nano ($0.05/$0.40) for classification, routing, extraction at scale.

Pattern Route up

  • Run nano/mini first; escalate to 5.4/5.5 only when the cheap tier fails a check.

Calling GPT-5 through a gateway

DataLLM Lab carries GPT-5.4, GPT-5.4 Pro, the GPT-5 Codex variants, and the GPT-5/mini/nano tiers today — reachable with one OpenAI-compatible key alongside Claude, Gemini, Grok and DeepSeek, with automatic failover:

client = OpenAI(base_url="https://www.datallmlab.com/v1", api_key="$DATALLMLAB_API_KEY")
# reaches openai/gpt-5.4, anthropic/claude-opus-4.7, google/gemini-3.1-pro, ...

Call GPT-5 and 300+ models with one key

GPT-5.4, GPT-5 Codex, Claude Opus 4.7, Gemini 3.1 Pro, DeepSeek V3.2 and more — one OpenAI-compatible endpoint, live price comparison, automatic failover.

FAQ

How much does the GPT-5 API cost?

Per 1M tokens: GPT-5.5 $5/$30; GPT-5.4 $2.50/$15; base GPT-5 $1.25/$10; GPT-5 mini $0.25/$2; GPT-5 nano $0.05/$0.40; GPT-5.4 Pro $30/$180. Cached input and Batch add discounts.

How do I get an OpenAI API key for GPT-5?

Sign up at platform.openai.com, add billing, create a key, set OPENAI_API_KEY. It's the native OpenAI format. Or reach GPT-5 via a gateway like DataLLM Lab.

What's the cheapest GPT-5 model?

GPT-5 nano ($0.05/$0.40) for simple high-volume tasks; GPT-5 mini ($0.25/$2) next; base GPT-5 ($1.25/$10) a strong mid-tier.

Is the GPT-5 API free?

No — usage is billed per token (some trial credit for new accounts). Free ChatGPT is manual-use only. For free prototyping, use a provider with a free tier (e.g. Gemini) or a gateway trial.

Which GPT-5 model should I use?

GPT-5.5/5.4 for agentic/frontier work, base GPT-5 as mid-tier, mini/nano for cheap high-volume, Codex for coding agents. Route cheaper-first, escalate on hard cases.

What's the difference between GPT-5.5 and GPT-5.4?

GPT-5.5 is the newer, more agentic tier (leads terminal/tool-use, ~2× long-context retrieval over 5.4) at double the price. See the GPT-5.5 review.

Written by
Kevin Fan

Founder of DataLLM Lab, the unified LLM gateway. Kevin tests models the boring way — same prompts, real costs, unedited outputs — and writes up what the runs actually show.

One API for every model

One API, every model.

Get a single API key for Claude Opus 4.7, GPT-5.4, and 300+ more — with automatic price comparison and routing to the best model for every request.