Codex CLI is open source and Claude Agent SDK is not, so the question is whether you want source access and the option to fork, or would rather have a vendor accountable for it.
The Claude Code loop as a library, for agents that are not about code.
Same harness as Claude Code, but you own the entrypoint and the tool surface.
OpenAI's terminal coding agent.
| Claude Agent SDK | Codex CLI | |
|---|---|---|
| Licence | Proprietary | Open source |
| Pricing | usage based | paid |
| Self-hostable | No | No |
| Languages | TypeScript, Python | Any language |
| Install | npm install @anthropic-ai/claude-agent-sdk | npm install -g @openai/codex |
| Keys required | ANTHROPIC_API_KEY | OPENAI_API_KEY |
Codex CLI is open source and Claude Agent SDK is not, so the question is whether you want source access and the option to fork, or would rather have a vendor accountable for it. Claude Agent SDK: The Claude Code loop as a library, for agents that are not about code. Codex CLI: OpenAI's terminal coding agent.
Claude Agent SDK is a hosted service only. Codex CLI is a hosted service only.
Claude Agent SDK is proprietary (usage based). Codex CLI is open source (paid).
Every page here answers to Accept: text/markdown and returns the same content at roughly a tenth the tokens. No separate site, no toggle — same URL.
curl -s -H "Accept: text/markdown" https://newagent.build/compare/claude-agent-sdk-vs-codex-cli