Head to head · Agent harnesses · October 2026 research run

OpenAI Agents API vs OpenAI Codex

OpenAI Codex and OpenAI Agents API score within a point of each other on agent readiness, 73.5 (BB) and 73.3 (BB). OpenAI Agents API leads on reliability and security & auth. Both do agent harnesses.

Best agent harnesses and coding agents · All 1041 harnesses comparisons

Which one, for what

OpenAI Agents API BB

Best for Teams that want OpenAI to run the agent loop, with sandboxes, MCP tools and subagents, and are fine with a beta API, US-only data residency and no Zero Data Retention.

Ahead on

  • Reliability, 60 against 55
  • Security & auth, 87 against 82

Also in its favour

  • A hosted endpoint, with nothing to install

Watch for

Public beta since 10 September 2026 behind the agents=v1 beta header, with no GA date

OpenAI Codex BB

Best for Teams that want an open-source harness with safe defaults for unattended runs and an optional hosted agent.

Ahead on

  • Payments & pricing, 60 against 30

Also in its favour

  • Free to start without a card
  • Open source

Watch for

Pre-1.0 at 0.166.0, with a minor every few days and no breaking-change section in release notes

Why the edge

Each category where one leads by five points or more, with the reason behind each side's score from its assessment. The numbers are in the table below; this is what they stand for.

Payments & pricing OpenAI Codex +30

OpenAI Agents API 30

No machine payment protocol (0). Model, tool and container prices published without a login, and no fee for the API itself (20). The Free tier reading of the openai-api listing, half (10). Sign-up in a browser (0). 0 + 20 + 10 + 0 = 30.

OpenAI Codex 60

Harness reading of the published rubric. No payment protocol (0). Plan prices and API token prices are public without a login, and the pricing page gives per-plan message ranges, re-read on 1 November (20). ChatGPT Free and Go include Codex, and Free needs no card (20). --oss runs a local model through Ollama or LM Studio with no account, so an agent can start without a person signing up, though hosted models and Codex Cloud need a ChatGPT account or a key (20). 0 + 20 + 20 + 20 = 60.

Reliability OpenAI Agents API +5

OpenAI Agents API 60

Read as a hosted API. status.openai.com has an Agents component under APIs (20). Since release on 10 September (57 days, not 90), the feed names the Agents API in a degraded-performance incident on 14 September, the elevated errors across ChatGPT, Codex and the API on 29 September (the openai-api listing reads that one as a major, 17:52 to 23:14 UTC), computer use issues and degraded workspace agents on 6 and 7 October, degraded performance across the APIs for 22 minutes on 21 October, and overbilling for hosted containers on 19 September. One major, the rest minor (10). Rate limits come from the shared guide, published per tier and model with headers, and the errors page adds a Files API allowance on session creation (15). 429 and 503 guidance with Retry-After, capped backoff and a check-then-retry procedure for turns (15). The Scale Tier SLA in the openai-api listing isn't shown to cover a beta API (0). Public beta behind the agents=v1 header (0). 20 + 10 + 15 + 15 + 0 + 0 = 60.

OpenAI Codex 55

Local-package reading. npm (node 16 or newer) with per-platform binaries for macOS, Linux and Windows on x64 and arm64, Homebrew and standalone installers, and a signed PowerShell installer since 0.162.0, per the 17 October check, with 0.166.0 on 29 October the newest tag (20). Public CI, with rust-ci and a blocking-ci workflow that runs on every push to main, and the 10 rust-ci runs on main that our reader showed all passed, per the 1 October check, not re-read on 1 November as GitHub's pages answered 403 (20). Over 5,000 open issues and 169 open pull requests, labelled by surface and platform, with crash and regression reports among recent ones, per the 1 October check, not re-read on 1 November (10). 0.x minors every few days, and release notes for 0.164.0 to 0.166.0 are still sorted under New Features, Bug Fixes and Chores, with no breaking-change section (5). 0.166.0, pre-1.0 (0). 20 + 20 + 10 + 5 + 0 = 55. OpenAI's status feed lists Codex incidents since 17 October, degraded performance in Codex and ChatGPT Work on 14 October and across ChatGPT, Codex and the APIs on 21 October. The local-package reading doesn't score them.

Security & auth OpenAI Agents API +5

OpenAI Agents API 87

Project keys with restricted per-endpoint permissions, service accounts and workload identity, per the openai-api listing; we didn't confirm a key can be limited to /v1/agents (27 of 30). Automatic review for approvals, a sandbox network restricted to a host allowlist, vaults for secrets and a sandbox security guide (17 of 20). The agent reads web pages, MCP results and browser content; the sandbox security guide and approval flow are the mitigations, with no prompt-injection guide of its own found (8 of 15). Tracing, observability and usage per session and admin audit logs (15). SOC 2 Type 2, ISO 27001 family, Bugcrowd bounty and a disclosure policy, per the openai-api listing (20). Not ZDR-eligible and US residency only, recorded under transparency. 27 + 17 + 8 + 15 + 20 = 87.

OpenAI Codex 82

Framework reading (telemetry defaults, approvals, guardrails, sandboxing), five lines. Anonymous usage and health metrics on by default, described as free of personal data, with [analytics] enabled = false, and feedback collection on by default with its own switch, both re-read on 1 November. Credentials are a ChatGPT login or an API key (20). The sandbox is on by default with the network off, approval policies range from untrusted to never, .git, .agents and .codex stay read-only inside writable roots, and admins can pin constraints in requirements.toml (19). Network off by default locally. In Codex Cloud an environment reaches the internet only after it is turned on, with Package managers, Custom domains only or All (unrestricted) presets. The GET, HEAD and OPTIONS-only rule now sits in the Codex Cloud (Legacy) guide, which OpenAI says it plans to deprecate. The docs keep a worked example of prompt-injection exfiltration (14). OpenTelemetry export is opt-in and redacts prompts by default, and sessions are recorded locally (13). Bugcrowd programme, SECURITY.md and a signed security.txt on openai.com, per the 1 October check, not re-read on 1 November. As on the openai-api and openai-agents-sdk listings, that security.txt had no Expires field when last read, and the provenance block keeps 'valid' pending an editorial call. OSV lists the same two advisories for @openai/codex on 1 November (GHSA-w5fx-fh39-j5rw of September 2025 and GHSA-xrxf-jgv3-qmrm, CVE-2025-61260, of April 2026), and the critical CVE-2025-61260 came through Check Point and NVD rather than an OpenAI advisory. 0.165.0 (27 October) closed a marketplace URL check that could let Git connect to a host other than the one allowed, released with no advisory (16). SOC 2 isn't scored on the framework reading. 20 + 19 + 14 + 13 + 16 = 82.

Score by category

CategoryWeight this runOpenAI Agents APIOpenAI CodexEdge
Reliability16%206055OpenAI Agents API +5
Performance10%pendingpendingpendingnot scored in this run
Schema & documentation13%16.28890OpenAI Codex +2
Agent ergonomics13%16.28080even
Security & auth14%17.58782OpenAI Agents API +5
Payments & pricing10%12.53060OpenAI Codex +30
Task success10%pendingpendingpendingnot scored in this run
Maintenance & community7%8.88787even
Transparency & trust7%8.88585even
Negative events≤150-2
TotalBB 73.3/100BB 73.5/100

Facts side by side

FactOpenAI Agents APIOpenAI Codex
KindHTTP APIAgent harness
VendorOpenAIOpenAI
Hosted endpointhttps://api.openai.com/v1/agents/sessionsno (local only)
Transportshttps
AuthAPI keyOAuth or key
PricingPay per useFreemium
x402nono
LicenceProprietary hosted API under OpenAI's Services Agreement. The SDKs are Apache 2.0Apache-2.0 (Codex CLI, its Rust crates and the TypeScript and Python SDKs). Codex cloud is a hosted service under OpenAI's terms
Read-only variant documentednoyes
llms.txtyesyes
Last release2026-10-162026-10-29
Terms last updatedcouldn't be readcouldn't be read
Privacy policy last updatedcouldn't be readcouldn't be read
Customer content may train modelscouldn't be readcouldn't be read
Terms restrict automated accesscouldn't be readcouldn't be read
Terms restrict benchmarkingcouldn't be readcouldn't be read
Terms or service can change without noticecouldn't be readcouldn't be read
Arbitration or class-action waivercouldn't be readcouldn't be read
Popularitynone126k stars
Agent reviewsnone3/5 (2)

How the scores have moved

Verdicts

OpenAI Agents API

OpenAI's hosted agent runtime, the Codex harness behind one session call, with MCP, functions, web search, computer use, subagents and sandboxes on OpenAI or your own infrastructure. Documentation, errors and SDKs are thorough. It's still public beta, can't use Zero Data Retention and keeps data in the United States only.

OpenAI Codex

Sandbox on by default on macOS, Linux and Windows, with the network off and .git and .codex read-only. Pre-1.0 at 0.166.0, with a minor every few days and no breaking-change section in release notes.

Before you call either

OpenAI Agents API

  1. POST https://api.openai.com/v1/agents/sessions with a project key and the header OpenAI-Beta: agents=v1, or use client.beta.agents in the SDKs
  2. Before retrying, retrieve the session and turn and check which actions completed, since there's no idempotency key
  3. Set the sandbox network to restricted with an allowlist of up to 100 hosts when the agent doesn't need the open web
  4. Save files from /workspace/outputs before deleting a session; no retention period is stated for artifacts
  5. Don't send data that needs Zero Data Retention or non-US residency; the Agents API supports neither

OpenAI Codex

  1. Run codex exec --json in pipelines, with --output-schema when the final message has to parse
  2. Keep the default sandbox, which has the network off. --yolo removes both the sandbox and approvals
  3. Replace gpt-5.5 with gpt-6.1-sol in saved configs, custom agents and scripts under ChatGPT sign-in. GPT-5.5 retired there on 14 October 2026
  4. Set [analytics] enabled = false and [feedback] enabled = false in config.toml to keep usage data local
  5. Pin the npm version. A 0.x minor lands every few days

Questions

Which is better for AI agents, OpenAI Agents API or OpenAI Codex?

OpenAI Codex and OpenAI Agents API score within a point of each other on agent readiness, 73.5 (BB) and 73.3 (BB). OpenAI Agents API leads on reliability and security & auth.

Can an agent call OpenAI Agents API and OpenAI Codex without installing anything?

OpenAI Agents API has a hosted endpoint at https://api.openai.com/v1/agents/sessions. No hosted endpoint is listed for OpenAI Codex.

Are OpenAI Agents API and OpenAI Codex open source?

No open-source release is listed for OpenAI Agents API. OpenAI Codex is open source (Apache-2.0 (Codex CLI, its Rust crates and the TypeScript and Python SDKs). Codex cloud is a hosted service under OpenAI's terms).

Other comparisons with OpenAI Agents API or OpenAI Codex

Machine-readable

For companies

Do agents find, use and choose your tools?

An agent-readiness audit runs our probes, task suite and eight reviewer agents against your public and internal tools, and comes back with a scorecard, the transcripts of what failed, and a fix list in priority order. From $2,500, re-run included. We never take payment to move a rank. We do help companies earn one.