The Agents API gives your application access to the Codex harness through an OpenAI-managed API. OpenAI manages sessions, orchestration, context compaction, and recovery while your application provides tools and chooses its execution environment. Agents can operate in a sandbox where they can execute code, edit files, connect to MCP servers, and produce artifacts. Model usage is billed at the selected model’s API rates . OpenAI tools use their standard rates , and OpenAI-hosted sandboxes use standard container rates . Try these complete examples: Create and run a directory-tree script in an OpenAI-hosted sandbox. Compare release notes with subagents and combine their findings into one answer. Explore complete applications: Incident response agent : investigate alerts and request approval for recovery actions. Slack bot : investigate requests using connected workplace tools. Data analyst : answer warehouse questions with read-only SQL.…