· Harness/ Head to head

Claude Agent SDK vs Codex CLI

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.

Proprietary · usage based · hosted service only · SDKs for TypeScript and Python

Same harness as Claude Code, but you own the entrypoint and the tool surface.

Codex CLI

OpenAI's terminal coding agent.

Open source · paid · hosted service only

· Side by side/ 5 of 6 differ
Claude Agent SDKCodex CLI
LicenceProprietaryOpen source
Pricingusage basedpaid
Self-hostableNoNo
LanguagesTypeScript, PythonAny language
Installnpm install @anthropic-ai/claude-agent-sdknpm install -g @openai/codex
Keys requiredANTHROPIC_API_KEYOPENAI_API_KEY
· Common questions/ FAQ

What is the difference between Claude Agent SDK and Codex CLI?

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.

Can Claude Agent SDK and Codex CLI be self-hosted?

Claude Agent SDK is a hosted service only. Codex CLI is a hosted service only.

Are Claude Agent SDK and Codex CLI open source?

Claude Agent SDK is proprietary (usage based). Codex CLI is open source (paid).

Build a stack with Claude Agent SDKAll harness options
· For agents/ This page, machine-readable

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