Claude Code API Documentation
Where to find Claude Code API documentation, how Claude Code CLI differs from the Agent SDK and Claude API, and which docs to use for automation.
There is no single "Claude Code API" page that covers every use case. The right documentation depends on whether you are using the CLI, the Agent SDK, or the lower-level Claude API.
Last checked on May 24, 2026. The Claude Code SDK has been reorganized into the Claude Agent SDK. Older links and package names may be stale.
Short Answer
- Use Claude Code docs for CLI commands, installation, authentication, permissions, MCP, memory, and editor integrations.
- Use Agent SDK docs when you want to build programmatic agents that reuse Claude Code-style tools, sessions, skills, hooks, and MCP.
- Use Claude API docs when you want direct model calls, pricing, rate limits, prompt caching, batch processing, and Messages API behavior.
Which Documentation Should You Open?
| You want to... | Use this documentation | Why |
|---|---|---|
Install or run claude | Claude Code setup and CLI reference | This is the terminal product. |
| Automate a one-shot CLI task | Claude Code CLI reference | claude -p, output formats, permissions, and auth flags live there. |
| Build an app around Claude Code-style agents | Agent SDK docs | The SDK handles tools, sessions, MCP, skills, and agent workflows. |
| Call Claude models directly | Claude API docs | Direct API calls require your own tool loop and billing controls. |
| Track pricing and rate limits | Claude pricing and API docs | Prices, token billing, and provider limits are platform concerns. |
| Configure project behavior | Memory, skills, hooks, settings docs | These control how Claude Code reads project context. |
CLI vs Agent SDK vs Claude API
| Surface | Best for | You manage |
|---|---|---|
| Claude Code CLI | Interactive local development, terminal workflows, quick automation. | Repository state, permissions, credentials, local tools. |
claude -p | Simple scripts and CI checks. | Output parsing, credentials, allowed tools, failure handling. |
| Agent SDK | Productized agents, long-running sessions, structured workflows. | Hosting, sandboxing, approvals, tool policy, session lifecycle. |
| Claude API | Direct model calls in your own app. | Tool loop, prompts, context, rate limits, retries, billing. |
Documentation Map
- Start with Claude Code docs if your question involves the CLI.
- Open CLI reference for flags such as
--print,--output-format,--permission-mode, and--allowedTools. - Open Agent SDK overview for programmatic agents.
- Open Use Claude Code features in the SDK when you need
CLAUDE.md, skills, hooks, or settings in SDK runs. - Open Claude API pricing and rate limits before running production automation.
Common Confusions
| Confusion | Correct framing |
|---|---|
| "Claude Code API" | Usually means either claude -p, Agent SDK, or direct Claude API. Clarify the surface first. |
| "Can I use my Pro plan in scripts?" | Some subscription OAuth flows work for Claude Code, but API-key automation bills differently. Confirm auth and billing. |
| "Do I need MCP for an API integration?" | Not always. MCP is for tool connections; direct API calls may be simpler. |
| "Can the SDK register skills programmatically?" | Skills are filesystem artifacts loaded through SDK settings. |