What's the difference between the OpenAI Agents SDK and the Codex SDK?
The OpenAI Agents SDK is a general framework, a few primitives, agents, handoffs, and guardrails, for building any agent you design; the Codex SDK is narrower, a library that only starts, resumes, and streams threads on OpenAI’s own Codex coding agent.
The Agents SDK gives you pieces to assemble: which tools an agent carries, which specialist it hands a task to, what its guardrails check going in and out. It defaults to OpenAI’s Responses API and reaches other providers only through adapter packages still in beta; OpenAI’s own docs call it “a production-ready upgrade of our previous experimentation for agents, Swarm.” The Codex SDK gives you no pieces at all. It drives one fixed agent, the harness behind the Codex CLI, app, and IDE extension: startThread() opens a run, and a past thread resumes or streams by its id, enough to trigger Codex from a CI pipeline, but what Codex does isn’t yours to configure.
Reach for the Agents SDK to design an agent’s own logic. Reach for the Codex SDK only to run OpenAI’s own Codex on your code as is. Underneath either one, tool calling works the same way: a structured call naming a tool and its arguments.
sources
- OpenAI Agents SDK documentation fetched
- OpenAI Codex SDK documentation fetched