Agent SDK vs API vs Claude Code
Also: Surface selection · Build vs buy for agents · Runtime choice
Choosing the right Claude build surface: raw API, the Agent SDK harness, or the full Claude Code product.
Why CCAR-P tests this
Picking the wrong abstraction wastes engineering effort or forfeits needed control, so the exam checks whether you match the surface to the control-versus-maintenance trade-off.
These three are different levels of abstraction over the same model, and the exam wants you to choose by how much control you need versus how much you want to build and maintain. The Messages API is the lowest level: you own the agent loop, tool orchestration, context management, and retries. Maximum control, maximum code you must write and keep working.
The Claude Agent SDK is a harness that provides the agentic loop, tool execution, context handling, and permissioning so you build a custom agent without reinventing the plumbing — the right pick when you need a bespoke, embedded, or headless agent but not a raw protocol. Claude Code is the fully built product: an interactive and headless coding agent with Skills, MCP, subagents, hooks, and permissions already assembled — the right pick when the packaged developer workflow fits and you would rather configure than build.
The decision rule is use the highest-level surface that meets your requirements. Reach for Claude Code when it already does the job; drop to the Agent SDK when you need a custom agent it cannot express; drop to the raw API only when you need control neither higher layer offers. Building on the API what the SDK already provides — or rebuilding Claude Code on the SDK — is the enablement anti-pattern.
Exam trap
Defaulting to the raw Messages API for full control when the Agent SDK or Claude Code already provides what you need trades maintenance burden for control you will not use — pick the highest-level surface that satisfies the requirement.
Commonly confused with
Related concepts
Independent, unofficial study material from Claude Cert Prep. Not affiliated with Anthropic.