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 documentationWhy
Install or run claudeClaude Code setup and CLI referenceThis is the terminal product.
Automate a one-shot CLI taskClaude Code CLI referenceclaude -p, output formats, permissions, and auth flags live there.
Build an app around Claude Code-style agentsAgent SDK docsThe SDK handles tools, sessions, MCP, skills, and agent workflows.
Call Claude models directlyClaude API docsDirect API calls require your own tool loop and billing controls.
Track pricing and rate limitsClaude pricing and API docsPrices, token billing, and provider limits are platform concerns.
Configure project behaviorMemory, skills, hooks, settings docsThese control how Claude Code reads project context.

CLI vs Agent SDK vs Claude API

SurfaceBest forYou manage
Claude Code CLIInteractive local development, terminal workflows, quick automation.Repository state, permissions, credentials, local tools.
claude -pSimple scripts and CI checks.Output parsing, credentials, allowed tools, failure handling.
Agent SDKProductized agents, long-running sessions, structured workflows.Hosting, sandboxing, approvals, tool policy, session lifecycle.
Claude APIDirect model calls in your own app.Tool loop, prompts, context, rate limits, retries, billing.

Documentation Map

  1. Start with Claude Code docs if your question involves the CLI.
  2. Open CLI reference for flags such as --print, --output-format, --permission-mode, and --allowedTools.
  3. Open Agent SDK overview for programmatic agents.
  4. Open Use Claude Code features in the SDK when you need CLAUDE.md, skills, hooks, or settings in SDK runs.
  5. Open Claude API pricing and rate limits before running production automation.

Common Confusions

ConfusionCorrect 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.

Official Sources