Devlery
Blog/OpenAI

OpenAI Opens the Codex Agent Harness as an API, With US-Only Data and No ZDR

OpenAI put the Codex harness behind the Agents API in public beta on September 10. The API itself is free and a 4GB hosted sandbox costs $0.12 per 20 minutes, but beta data stays in the US and ZDR does not apply.

OpenAI Opens the Codex Agent Harness as an API, With US-Only Data and No ZDR
AI 요약
  • OpenAI opened the agent loop that runs Codex to all developers as the Agents API public beta.
  • The API adds no fee of its own; a 4GB hosted sandbox adds $0.36 per hour.
  • During the beta, data is stored only in the US and Zero Data Retention does not apply.

The Agents API that OpenAI released on September 10 is an API that runs an AI task lasting hours through to the end for you. Instead of one request returning one answer, you hand over a job, and the model runs code, writes files, splits work across sub-agents if it needs to, and returns the result. It is a public beta, so any developer with an API key can use it today. The Hacker News thread reached 345 points and 180 comments.

OpenAI says this is the same harness it uses in Codex and ChatGPT for Work, lifted out as a product. A harness is the execution loop that repeatedly calls the model, runs tools, manages conversation history, and retries after failures. That loop runs on OpenAI's servers. Where commands and file operations actually execute (the sandbox) is the developer's choice.

OpenAI Agents API architecture diagram. The application sends a task, and the OpenAI-operated harness sends tool calls to a sandbox

What developers used to build themselves

The Agents API replaces the whole backend needed to operate an agent. The existing Responses API is one request, one response. Building an agent that runs for hours meant implementing a job queue, a database for session state, a sandbox pool, and a retry policy yourself. The open-source Agents SDK also provides a loop, but that loop ran on your own servers.

Now a single session-creation call hands that work to OpenAI. The example below is developer code.

session = client.beta.agents.sessions.create(
    agent={
        "model": "gpt-6-astra",
        "tools": [{"type": "web_search"}, {"type": "programmatic_tool_calling"}],
        "multi_agent": {"enabled": True, "max_concurrent_subagents": 4},
    },
    environment={"type": "openai_hosted"},
    input="Find why the service's 5xx errors increased and write it up in /workspace/outputs",
)

Progress arrives by streaming or webhook, and you can add instructions mid-task. The harness ships with four capabilities:

  • Automatic context compaction: when a session nears the model's context limit, the harness summarizes earlier turns and keeps going.
  • Tool search: instead of loading every tool definition, it loads only the ones it needs, saving tokens.
  • Programmatic tool calling: it runs several tool calls in parallel and filters the results in code, passing only the relevant parts back to the model.
  • Sub-agents: a large task is split among sub-agents that work concurrently, each in its own context. The example configurations use 3 and 4 concurrent sub-agents.

Tools can be MCP servers, your own function definitions, or web search. The harness code is public in the Apache-2.0 openai/codex repository, so you can read how it behaves.

The only before-and-after numbers are customer quotes on OpenAI's announcement page. Ciridae, which previously ran its own loop, said its eval score rose from 0.71 to 0.85 and latency fell to a quarter. SafetyKit reported a 60% lower cost per case, and Hypha an 86% drop in failed responses. None of the companies disclosed what setup they used before, so the figures are hard to verify independently.

The bill comes from the sandbox, not the loop

OpenAI says the Agents API itself carries no extra charge. You pay for model tokens, tools such as web search, and container time when you use an OpenAI-hosted sandbox. If you pick your own infrastructure or a partner sandbox (Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, Vercel), compute is billed there.

Hosted sandbox prices are listed per 20 minutes on the pricing page, with actual billing per minute and a five-minute minimum. Here is how it compares with Anthropic's Claude Managed Agents, which entered public beta earlier.

ItemOpenAI Agents APIClaude Managed Agents
StatusPublic beta (September 10, 2026)Public beta (April 2026)
Loop operation feeNone$0.08 per running session hour
Hosted sandboxPer 20 minutes: 1GB $0.03, 4GB $0.12, 16GB $0.48, 64GB $1.92Included in the $0.08, no separate container charge
Idle timeDocs do not say whether it is excludedIdle time is not billed
Top model tokensGPT-6 Astra: $10 input, $50 outputClaude Fable 5.1: $10 input, $50 output
Available modelsOpenAI modelsClaude models

Sources: OpenAI API pricing page and Claude API pricing docs (checked 2026-09-12). Token prices per 1M tokens.

Take a one-hour session that uses 50,000 input tokens and 15,000 output tokens. GPT-6 Astra and Claude Fable 5.1 have identical token prices, so tokens cost $1.25 on either side. The difference is the execution environment.

  • GPT-6 Astra + OpenAI 4GB sandbox: $1.25 tokens + $0.36 container = $1.61.
  • Claude Fable 5.1 + Managed Agents: $1.25 tokens + $0.08 runtime = $1.33.

If a 1GB sandbox is enough, OpenAI's container cost drops to $0.09 per hour, roughly the same as Claude's runtime fee. The more memory you allocate, the more the OpenAI side costs. A commenter on OpenAI's community announcement warned others to price out containers before launching them, saying they had learned that the expensive way.

Beta terms: US storage, no zero-retention contracts

Access is wide open, with one exception. There is no application or waitlist, and the API works in every OpenAI API supported country. In APAC that list includes Singapore, Japan, Australia, India, Indonesia, Malaysia, the Philippines, Thailand, Vietnam, South Korea, and Taiwan; Hong Kong and mainland China are not on it.

ItemDetails
WhoEvery developer with an OpenAI API key (public beta)
PriceAgents API free; tokens, tools, and hosted sandbox time at standard rates (USD)
RegionAll OpenAI API supported countries, including Singapore and most of APAC
Data residencyUS only during the beta; no APAC or EU region named
Zero Data RetentionNot supported, even with a self-hosted or partner sandbox
SDKclient.beta.agents.sessions namespace (beta)

The exception is where data lives and how long it is kept. The overview docs say the Agents API currently supports data residency only in the United States and does not support ZDR (a contract under which OpenAI does not store request data). Putting the sandbox on your own servers does not change that: session state and conversation history still pass through OpenAI's harness. The docs name no other region and give no timeline for one. Companies already using OpenAI under a ZDR agreement cannot put production data into this API yet, and neither can services that must keep customer data in a specific region. A Singapore team moving personal data into the US-only store also has to satisfy the PDPA's transfer limitation obligation, which requires comparable protection for data sent overseas.

The most common worry in the Hacker News comments was lock-in. One user wrote that since receiving the Assistants API retirement notice last year, they avoid any API that stores state on the vendor's servers. The Assistants API shut down on August 26, 2026, with no tool to migrate threads automatically. The Agents API arrived about two weeks later. Commenters also pointed out that it only runs OpenAI models; unlike AWS Bedrock AgentCore, you cannot switch model vendors mid-session.

If your team runs its own agent loop in production, move your longest-running job to the Agents API with environment.type: "self_hosted". Run the same 20 inputs through both and compare completion rate, tokens per session, and retry count. Keeping the sandbox self-hosted lets you compare the harness alone, without container fees. Whether to go to production depends on those numbers plus a check that US-only storage and the lack of ZDR fit your data policies.