# OpenAI Agents API: what you still own when the harness is hosted

> Public-beta Agents API runs the Codex harness for you. Keep skills, MCP, schema, and deploy in your repo — and pick the sandbox that fits production.
> By Dave · 2026-09-12
> Source: https://otf-kit.dev/blog/openai-agents-api-owned-repo

On September 10, 2026, OpenAI put the Agents API into public beta: the same Codex-style harness that manages long sessions, tools, and subagents, exposed as an API your app can call. The useful question is not "another agent framework shipped." It is what you should stop building yourself, and what still has to live in the product repo you own.

If you have been wiring prompt chains, hand-rolled compaction, and custom subagent orchestration just to keep a coding or ops agent alive for hours, that is the work this API targets. OpenAI hosts and maintains the harness. You still choose the compute environment, the tools, the skills, and the domain boundaries of your product.

![Dex, Luna, Byte, and Nova at a hologram dashboard for a managed Agents API session beside an owned product repo](https://cdn.otf-kit.dev/thumbnails/openai-agents-api-owned-repo-hero-20260912a.png)

## What changed for production builders

The announcement is explicit about the split. Useful agents need a harness that manages context, uses tools efficiently, and coordinates subagents, plus infrastructure that can run for days with files, code execution, and intermediate artifacts. The Agents API brings that harness to developers as a public beta.

Practically, that changes a few decisions:

- Stop treating long-session compaction as a weekend project. The API automatically compacts earlier context as a session approaches its limit so workflows can span multiple context windows without your own compaction logic.
- Stop inventing a one-off subagent bus for parallel research or coding. Multi-agent support can break work into pieces, give each subagent its own context, and let the main agent reassemble results.
- Stop assuming "agent platform fee" is a separate line item. OpenAI says there are no additional fees for using the Agents API during the beta — you pay for the tokens and tools the agents use, plus standard rates for OpenAI tools and OpenAI-hosted sandboxes when you use those.

None of that replaces your product. It replaces the part that used to be invisible glue around the model.

## Harness, environment, and the repo you keep

Docs frame four concepts: agent, environment, session, and events/items.

- **Agent** — model, instructions, tools, and MCP servers available to the run.
- **Environment** — optional sandbox or computer where the agent reads files, loads skills, and runs commands.
- **Session** — durable instance that works across turns without you rebuilding conversation state from scratch.
- **Events and items** — inputs you send and outputs produced during the session.

That split matters for ownership. The harness can be hosted. The environment can be OpenAI-hosted, a partner sandbox, or self-hosted. Your application still owns the product surface: schemas, auth, billing rules, deploy topology, approval gates, and the MCP servers that touch real customer data.

A minimal session create (sketch from the public docs) looks like this:

```javascript
import OpenAI from "openai";

const client = new OpenAI();

const session = await client.beta.agents.sessions.create({
  agent: {
    model: "gpt-6-astra",
    instructions:
      "Use connected tools carefully. Prefer read-only investigation before any write.",
    tools: [
      { type: "programmatic_tool_calling" },
      {
        type: "mcp",
        server_label: "openai_docs",
        transport: {
          type: "http",
          server_url: "https://developers.openai.com/mcp",
        },
      },
      { type: "web_search" },
    ],
    multi_agent: { enabled: true, max_concurrent_subagents: 4 },
  },
  environment: {
    type: "self_hosted",
    workspace_directory: "/workspace",
    capability_directories: ["/workspace/capabilities/skills"],
  },
  input: [
    {
      role: "user",
      content: [
        {
          type: "input_text",
          text: "Summarize how to attach an MCP server and list setup checks.",
        },
      ],
    },
  ],
});

console.log(session.id);
```

Treat model pins and tool lists as configuration you review, not as magic defaults that never change during a public beta.

![Decision board: managed Codex harness on one side, owned skills MCP schema and deploy on the other](https://cdn.otf-kit.dev/thumbnails/openai-agents-api-owned-repo-inbody-01-20260912a.png)

## When to call the API instead of DIY glue

Use the managed harness when the pain is orchestration, not domain logic:

- Sessions that must survive multiple context windows.
- Tool catalogs large enough that loading every definition every turn is wasteful — the API’s tool search loads relevant definitions as needed.
- Parallel investigation where subagents should not share one polluted context.
- Teams that want versioned harness improvements alongside model launches instead of rewriting glue for every model bump.

Keep DIY (or a thinner local agent loop) when:

- Your compliance story forbids the API’s current data controls.
- You only need a short, single-turn tool call with no durable session.
- The "agent" is really a deterministic workflow with fixed steps and no sandbox.

OpenAI documents an important constraint: the Agents API currently supports data residency only in the United States and does not support Zero Data Retention (ZDR). Choosing a self-hosted sandbox does not make the Agents API ZDR-eligible. If that blocks your product, the honest move is to keep the agent path off this API until the controls match your requirements — not to paper over it in marketing copy.

## Pick an environment on purpose

The announcement separates harness from compute. You can run in an OpenAI-hosted sandbox (same sandboxing lineage as Codex and ChatGPT), on your own infrastructure, or with ecosystem partners listed in the post, including Blaxel, Cloudflare, Daytona, DigitalOcean, E2B, Modal, Oracle, Runloop, and Vercel.

Choose based on what the agent must touch:

- **OpenAI-hosted** — fastest path to files, packages, skills, and artifacts when you do not need VPC placement.
- **Partner sandboxes** — when you need specific CPU/GPU/memory profiles, cold-start characteristics, or deployments inside your VPC.
- **Self-hosted** — when the workspace, secrets layout, and capability directories must match your existing production machine image.

Vercel’s changelog also called out building with the OpenAI Agents API on Vercel (Next.js, Functions, Queues, and Sandbox) on the same launch window. Treat that as a deploy option, not a requirement: the ownership question is still which repo holds your skills, MCP servers, and product schema.

![Byte and Nova choosing an OpenAI-hosted partner or self-hosted sandbox for an agent session](https://cdn.otf-kit.dev/thumbnails/openai-agents-api-owned-repo-inbody-02-20260912a.png)

## Ownership checklist that should stay in your repo

Before you move a production workflow onto the Agents API, write these down in the product repository — not only in a chat transcript:

1. **Skills and capability directories** — what the agent is allowed to load from disk, versioned next to the app.
2. **MCP and custom tools** — especially anything that can write to production. Pair this with the permission patterns in [safe tool permissions for AI agents](/blog/safe-ai-agent-tool-permissions).
3. **Domain schema and invariants** — tables, entitlements, and "never do this" rules the harness will not invent for you.
4. **Secrets and vault IDs** — how credentials enter the environment without leaking into prompts or logs.
5. **Steering and human approval** — which actions require a human before the session continues (deploys, refunds, data deletes).
6. **Deploy and rollback** — how you ship the app that creates sessions, not only how the agent edits files inside a sandbox.
7. **Prompt-injection assumptions** — untrusted tool output and user text still need the defenses in [prompt injection defenses for production](/blog/prompt-injection-defenses-production).

If those files only live inside a hosted session, you do not own the agent — you are renting a demo.

Repo conventions still matter when the harness is managed. The contract in [production repository conventions for AI coding agents](/blog/production-repo-conventions-for-ai-coding-agents) is the same idea: make the durable product knowledge visible to any agent path you run.

## A practical adoption sequence

1. Pick one internal workflow that already needs multi-step tool use (incident triage, doc review, issue reproduction).
2. Create a session with read-mostly tools first; enable multi-agent only after a single-agent path is stable.
3. Store skills and MCP configs in your repo; point `capability_directories` at that tree when self-hosting.
4. Measure token + tool cost against your DIY harness for the same task — OpenAI bills model usage at the selected model’s API rates and tools/sandboxes at their standard rates.
5. Gate write actions behind approvals until your tool-permission map is boring.
6. Only then attach the path to customer-facing product flows — and still run your ship checklist from [shipping an AI MVP to production](/blog/ship-ai-mvp-to-production-checklist).

Computer-use model jumps are a separate decision from harness hosting. If your bottleneck is GUI automation rather than session orchestration, start from [GPT-6 Astra computer use for builders](/blog/gpt-astra-computer-use-production) instead of forcing every problem through Agents API sessions.

## What not to do this week

- Do not rewrite your entire product as "an agent" because the API is new.
- Do not skip the US residency / no-ZDR constraint if that is a hard requirement.
- Do not leave skills only inside a sandbox image with no git history.
- Do not enable max concurrent subagents before you can explain what each subagent is allowed to touch.

The Agents API is a hosted Codex harness with durable sessions, compaction, tool search, programmatic tool calling, and optional subagents. Your edge remains the owned product repo: skills, MCP, schema, secrets, deploy, and the approval policy around dangerous tools. Ship that split on purpose.

## Sources

- [Introducing the Agents API (OpenAI, September 10, 2026)](https://openai.com/index/introducing-the-agents-api/)
- [Agents API overview (OpenAI developers docs)](https://developers.openai.com/api/docs/guides/agents-api/overview)
- [Configuring Agents (OpenAI developers docs)](https://developers.openai.com/api/docs/guides/agents-api/configuration)
- [Vercel changelog — Build with OpenAI Agents API on Vercel (September 10, 2026)](https://vercel.com/changelog)