Agents API: OpenAI runs the harness
The service maintains durable sessions and runs the Codex harness. Your application submits work, receives progress, and handles application function calls. An optional hosted or self-hosted environment provides compute. Choose it when managed orchestration fits your operational requirements.
Agents SDK: your application runs the runner
The SDK is an application library for building agents. Its runner manages the agent loop and handoffs, while your application controls deployment, storage integration, approval logic, and runtime lifecycle. An SDK session and an Agents API session are different resources.
Responses API: your application owns the loop
Responses supplies model inference and tool interfaces. Your application decides how to loop, execute custom functions, preserve state, and recover. It is useful for a focused model request or an existing orchestration system. Adding tools to a response does not create an Agents API session.
Migration is an architecture decision
Map tool handlers, state, approvals, monitoring, and cleanup before changing runtimes. Do not replace an import and assume session IDs, event types, or tool schemas are interchangeable. Compare a representative workload for correctness, latency, and total cost.
Read the official reference
Check the source for current API fields, account requirements, and service limits.
OpenAI: agents