OpenAI Agents SDK Pricing: Responses API Cost for Agents
What an OpenAI agent costs to run: GPT-5.5, GPT-5.4, GPT-5.4 mini, GPT-5.4 nano and GPT-5.3-Codex on the Responses API and Agents SDK, with cached and batch arithmetic and the ChatGPT Pro and Business break-evens.
The article text carries the review date. The rate table below is rebuilt from the live catalogue on every deploy.
Fastest win
The Agents SDK is free; the Responses API tokens underneath it are not. On a 12-step tool-using trace a run costs $0.94 on GPT-5.5 ($5/$30), $0.47 on GPT-5.4 ($2.50/$15), $0.14 on GPT-5.4 mini ($0.75/$4.50) and $0.038 on GPT-5.4 nano ($0.20/$1.25). Automatic prompt caching cuts those by roughly two-thirds, and GPT-5.4 mini is the cheapest model we would trust with a production tool loop.
The direct answer: $0.04 to $0.94 per agent run
An OpenAI agent costs between four cents and about a dollar per 12-step run depending on the model, and the SDK adds nothing. The Agents SDK (Agent, Runner) is an open-source orchestration layer over the Responses API; you pay the token rates of whichever model the agent uses. Using a 4,000-token system prompt plus tool schemas, 1,500-token tool results and 300 output tokens per step (166,800 input tokens and 3,600 output tokens over 12 steps), uncached run costs are:
| Model | $/1M in / out | Context | 12-step run | Approx. cached | Batch (approx. 50%) |
|---|---|---|---|---|---|
| GPT-5.5 Pro | $30 / $180 | 1M | $5.65 | n/a for loops | $2.83 |
| GPT-5.5 | $5 / $30 | 1M | $0.942 | $0.30 | $0.471 |
| GPT-5.4 | $2.50 / $15 | 1M | $0.471 | $0.15 | $0.236 |
| GPT-5.3-Codex | $1.75 / $14 | 400K | $0.342 | $0.12 | $0.171 |
| GPT-5.4 mini | $0.75 / $4.50 | 400K | $0.141 | $0.045 | $0.071 |
| GPT-5.4 nano | $0.20 / $1.25 | 400K | $0.038 | $0.012 | $0.019 |
Prices are USD per 1M tokens from our catalogue dated 2026-09-11. For GPT-5.4: 166,800 × $2.50 ÷ 1,000,000 = $0.417 input, plus 3,600 × $15 ÷ 1,000,000 = $0.054 output, total $0.471. GPT-5.5 Pro at 12× the GPT-5.4 rate belongs to one-shot hard problems, not loops.
How the Responses API bills a tool loop
A Responses API agent turn is client.responses.create with tools=[...] and input=[...]. The model returns function_call items; you run them, append function_call_output items and call again. Every call bills the full input list, so the twelfth call in the trace sends 23,800 tokens and the run sends 166,800.
Two Responses-specific mechanics change what you pay. previous_response_id stores the conversation server-side so you only send new items; this is a convenience, not a discount, because the stored context is still billed as input each turn. What it does do is keep your prefix byte-identical, which is what makes automatic caching fire. And reasoning tokens bill as output: GPT-5.5 and GPT-5.4 reason by default, so set reasoning={"effort": "low"} on worker agents that only need to pick a tool. Output is 11% of the GPT-5.4 run; input, nearly all of it repeated context, is the other 89%.
Prompt caching on OpenAI: automatic, roughly 90% off the repeated prefix
OpenAI applies prompt caching automatically to any request whose prefix matches a recent request, with cached input tokens billed at roughly 10% of the list input rate. There is no cache_control block to add; the work is keeping the prefix stable. Put the system prompt and tool definitions first, never re-order tools between calls, and keep timestamps and request IDs out of the prefix.
On the 12-step trace, caching brings GPT-5.4 from $0.471 to roughly $0.15 and GPT-5.4 mini from $0.141 to roughly $0.045. On a 30-step run (903,000 input tokens uncached) GPT-5.4 drops from $2.39 to roughly $0.49. Verify by reading usage.input_tokens_details.cached_tokens; if it stays at zero after the first step, something in the prefix is moving.
from openai import OpenAI
client = OpenAI()
tools = [{
"type": "function", "name": "lookup_invoice", "strict": True,
"description": "Fetch an invoice by number",
"parameters": {"type": "object", "properties": {"number": {"type": "string"}},
"required": ["number"], "additionalProperties": False},
}]
resp = client.responses.create(
model="gpt-5.4",
instructions=SYSTEM_PROMPT, # stable prefix: instructions + tools
tools=tools,
input=history, # growing list of items
reasoning={"effort": "low"},
max_output_tokens=2000,
)
u = resp.usage
cached = u.input_tokens_details.cached_tokens
# GPT-5.4: $2.50 in, ~$0.25 cached in, $15 out per 1M
cost = ((u.input_tokens - cached) * 2.5 + cached * 0.25
+ u.output_tokens * 15) / 1_000_000The prompt caching cost comparison sets this beside Anthropic's explicit cache_control and Gemini's context caching.
The Agents SDK Runner and what it changes about cost
The Agents SDK runs the loop for you: Runner.run calls the model, executes your @function_tool functions, appends results and repeats until the agent returns a final output or hits max_turns. It costs nothing extra but changes two things about spend. max_turns (default 10) is your step cap; set it deliberately. And handoffs carry the conversation into each new agent's context, which raises the input bill without making it obvious.
from agents import Agent, Runner, function_tool
@function_tool
def lookup_invoice(number: str) -> str:
return db.invoice(number)
agent = Agent(name="billing", model="gpt-5.4-mini",
instructions=SYSTEM_PROMPT, tools=[lookup_invoice])
result = Runner.run_sync(agent, task, max_turns=12)
usage = result.context_wrapper.usage
# GPT-5.4 mini: $0.75 in / $4.50 out per 1M; 12 reference steps ~= $0.14
run_cost = (usage.input_tokens * 0.75 + usage.output_tokens * 4.5) / 1_000_000Built-in hosted tools (web search, file search, code interpreter, computer use) are billed separately from tokens at per-use rates that are not in our catalogue, so check the vendor pricing page before enabling them. The content they return is then billed as normal input on every later step.
GPT-5.5 vs GPT-5.4 vs mini vs nano vs Codex: picking the tier
The cheapest model that still does this reliably: GPT-5.4 mini at $0.141 per 12-step run (roughly $0.045 cached). With strict: True on every function it follows schemas consistently, its 400K context covers any sane loop, and it costs 30% of GPT-5.4. It is our default for worker agents and for any loop whose tool calls are validated before execution.
GPT-5.4 nano at $0.038 per run is a third of mini again. Use it for classification-and-route steps, extraction and tool selection over a small tool set where a wrong call is cheap to catch. Do not make it the planner: when nano wanders it wanders for many steps, and 30 nano steps ($0.19) cost more than 12 mini steps.
GPT-5.3-Codex at $1.75/$14 ($0.342 per run) is the coding specialist. For agents that write and edit code it tends to finish in fewer steps than GPT-5.4 mini, which is the only reason to pay 2.4× more per step.
When to pay for the flagship: GPT-5.4 ($0.471) for open-ended tasks and anything with side effects; GPT-5.5 ($0.942) only as the planner in a multi-agent setup or where a single failed run costs more than about a dollar. GPT-5.5 is exactly 2× GPT-5.4 per run and must halve the failure rate or the step count to break even. The cheapest LLM for agents guide ranks all of these against Anthropic, Google and open-weight models on the same trace.
When ChatGPT Pro or Business beats the API
ChatGPT plans do not include API credit. ChatGPT Plus ($20), Pro ($200) and Business ($25 per seat) buy a person access to ChatGPT and the Codex agent inside it, with usage allowances rather than a token meter, so the comparison only holds for a human driving an agent interactively.
| Plan | Monthly price | GPT-5.4 runs at $0.47 (uncached) | GPT-5.4 runs at ~$0.15 (cached) |
|---|---|---|---|
| ChatGPT Plus | $20 | ~42 | ~133 |
| ChatGPT Business | $25 per seat | ~53 | ~166 |
| ChatGPT Pro | $200 | ~425 | ~1,330 |
A developer using Codex for a few coding tasks a day is well inside what Plus or Business covers, and Business adds admin controls and keeps workspace data out of training by default. Pro at $200 only makes sense for someone whose interactive use would otherwise exceed roughly 400 flagship runs a month. Our ChatGPT pricing and OpenAI Codex pricing pages have the plan details.
The API wins for anything unattended, parallel, or embedded in a product, and on price the moment routine steps go to mini or nano: 1,000 cached GPT-5.4 mini runs cost about $45, which no seat plan can back.
How to cap spend on an OpenAI agent
Apply all four; each catches a different failure:
max_output_tokensper call: 1,000 to 4,000 for tool-calling turns. This caps one turn, including reasoning tokens.max_turnsonRunner.run, or a manual step counter: 12 to 15 for most task types.- Stop conditions: a required
finishfunction, an abort on two identical consecutive function calls, and an abort on a tool error repeated twice. - A per-run USD budget computed from
usageafter each call, with cached tokens at roughly 10% of list. Abort past your ceiling and record the total per task to compute cost per successful task.
At GPT-5.4 rates a $0.50 per-run budget covers about 12 uncached reference steps or roughly 35 cached. For fan-out work that can wait, the Batch API runs at roughly 50% of list; it cannot run a live loop but can run 10,000 short agents overnight. See LLM batch API pricing and the AI cost calculator for monthly budgets.
Verdict
What it costs: $0.04 to $0.94 per 12-step run across the GPT-5 range before caching, roughly $0.01 to $0.30 after. Who should pay API rates: anyone running agents unattended, at volume, or in a product, with routine steps on GPT-5.4 mini or nano. Who should not: an individual developer using Codex interactively, for whom Plus or Business at $20 to $25 beats any plausible API bill. Cheapest way to get the result: GPT-5.4 mini with strict schemas and a stable cached prefix, GPT-5.4 for open-ended or side-effecting steps, GPT-5.5 as an occasional planner, max_turns set on purpose. See the Claude agent API cost and Gemini agent API cost guides for the other stacks, how much does an AI agent cost to run for the trace, and the ChatGPT 101 tutorial for API basics.
Key Takeaways
- →The Agents SDK is free; a 12-step agent run bills $0.94 on GPT-5.5, $0.47 on GPT-5.4, $0.34 on GPT-5.3-Codex, $0.14 on GPT-5.4 mini and $0.038 on GPT-5.4 nano
- →OpenAI prompt caching is automatic at roughly 10% of list input for a matching prefix; keep instructions and tools first and byte-identical
- →Built-in tools (web search, file search, code interpreter, computer use) are billed separately; check the vendor page, and remember their results bill as input on every later step
- →GPT-5.4 mini is the cheapest model we would trust with a production tool loop; nano is for classification and routing, not planning
- →ChatGPT Plus, Business and Pro do not include API credit; Plus covers about 42 uncached GPT-5.4 runs of interactive value, Pro about 425
- →Set max_turns deliberately and compute a per-run dollar budget from usage after every call
Editorial context
Who is this for?
Developers building on the Responses API or the Agents SDK who need a per-run cost by model, and teams deciding whether a ChatGPT seat plan or API billing fits an agent workload.
When NOT to use this
Consumers choosing between ChatGPT Free, Go and Plus; teams needing a cross-vendor ranking only, which the cheapest LLM for agents guide covers.
Pricing insights
The SDK is free and the tokens are not: 89% of a GPT-5.4 agent run is re-sent input, and OpenAI's automatic caching at roughly 10% of list turns a $0.47 run into about $0.15 provided the instructions and tools stay byte-identical.
Alternatives to consider
Claude Sonnet 5 at $2/$10 or Gemini 3.1 Pro at $2/$12 for a GPT-5.4-class agent; Gemini 3.8 Flash at $0.75/$3.75 or Claude Haiku 4.5 at $1/$5 for the mini tier; ChatGPT Plus or Business for interactive Codex use.
Final verdict
Default to GPT-5.4 mini with strict schemas and a stable prefix, escalate to GPT-5.4 for open-ended or side-effecting steps, use GPT-5.5 only as a planner, and pay for a ChatGPT seat rather than the API when a human is the one driving.
Frequently Asked Questions
How much does the OpenAI Agents SDK cost?
Nothing. It is an open-source library that orchestrates calls to the Responses API, and you pay only the token rates of the model each agent uses: $5/$30 per 1M for GPT-5.5, $2.50/$15 for GPT-5.4, $0.75/$4.50 for GPT-5.4 mini and $0.20/$1.25 for GPT-5.4 nano. Hosted tools such as web search are billed separately at rates on the vendor page.
How much does a GPT-5.4 agent run cost?
About $0.47 for a 12-step run that sends 166,800 input tokens and 3,600 output tokens (a 4,000-token system prompt and tools, 1,500-token tool results, 300 output tokens per step). With automatic prompt caching on a stable prefix that falls to roughly $0.15, and a 30-step run costs $2.39 uncached or roughly $0.49 cached.
Does the Responses API charge for previous_response_id context?
Yes. Storing the conversation server-side saves you re-sending items, but the stored context is still billed as input tokens on each turn. Its benefit is indirect: it keeps the prefix identical between calls, which is what makes automatic caching bill most of that context at roughly 10% of list.
Is GPT-5.4 mini good enough for an agent?
For worker agents and validated tool loops, yes. With strict function schemas it follows tool definitions reliably, costs $0.14 per 12-step run against $0.47 for GPT-5.4, and has a 400K context. Keep GPT-5.4 or GPT-5.5 for the planner role and for tool calls with side effects.
Is ChatGPT Pro cheaper than the API for agents?
Only for one person driving Codex interactively at very high volume. Pro costs $200 a month, roughly what 425 uncached or 1,330 cached GPT-5.4 agent runs would cost on the API, and includes no API credit. Unattended or product agents must use the API, and most developers are better served by Plus at $20 or Business at $25 per seat.
How much do OpenAI built-in tools cost in an agent?
Web search, file search, code interpreter and computer use are billed separately from tokens at per-use rates that are not in our catalogue, so check the vendor pricing page before enabling them. The content they return is billed as ordinary input tokens on every later step of the loop, which is often the larger cost.
Related
Free courses · no sign-up
Still deciding? Learn the basics first, then come back to the prices.