Skip to content
The Agents Index

Claude Agent SDK

A Python and TypeScript library that embeds Claude Code’s agent loop and tools.

Claude Agent SDK is a Python and TypeScript library for building agents with Claude Code’s agent loop, tools, permissions, sessions, and hooks. Applications run the Claude Code process on infrastructure they operate and authenticate with an Anthropic API key.

Best for
Developers already building on Claude (or Claude Code) who want its exact agent loop, tools and context management as a callable library, and are comfortable being single-vendor on Anthropic in exchange for the tightest possible integration with Claude Code's own capabilities.
Not for
Teams that need genuine multi-provider model flexibility in one agent loop. OpenAI Agents SDK, Google ADK and Microsoft Agent Framework all reach other vendors' models through a LiteLLM-style integration; the Claude Agent SDK doesn't, by Anthropic's own design decision.

What we checked

Pages last read
Facts checked
39 factsFrom 28 sources
AI answers
Named in 0 of 150Our October check

Claude Agent SDK in our research

All research

What we checked on Claude Agent SDK

YesPartlyNo

What it doesYes

Writes code

The agent calls the same file tools Claude Code uses, so it authors and edits code from a prompt.

An agent is an application that completes a task by planning its own steps and calling tools that read files, run commands, or edit code.

code.claude.com/docs/en/agent-sdk/overv…Checked

What it doesYes

Debugs and fixes

The vendor's own quickstart is an agent that locates crash bugs in a file and edits the fix in.

Use the Agent SDK to build an AI agent that reads your code, finds bugs, and fixes them, all without manual intervention.

code.claude.com/docs/en/agent-sdk/quick…Checked

What it doesYes

Writes tests

The agent-loop walkthrough has the agent updating and re-running a project's tests alongside its edits.

A complex task ("refactor the auth module and update the tests") can chain dozens of tool calls across many turns, reading files, editing code, and…

code.claude.com/docs/en/agent-sdk/agent…Checked

What it doesYes

Reviews code

The CLI surface is documented as a reviewer over a diff piped in from git or gh.

You can wrap a non-interactive call in a script to use Claude as a project-specific linter or reviewer.

code.claude.com/docs/en/headlessChecked

What it doesPartly

Whole-codebase work

Repo-scale work is handled by fanning out subagents and by automatic compaction; no whole-repo index is claimed.

A research-assistant subagent can explore dozens of files without any of that content accumulating in the main conversation.

code.claude.com/docs/en/agent-sdk/subag…Checked

What it doesPartly

Ships it

Bash gives it git and script execution, so a deploy command is reachable, but the SDK documents no deployment surface of its own.

Run shell commands, scripts, git operations

code.claude.com/docs/en/agent-sdk/agent…Checked

How much it does unattendedYes

Runs autonomously

With no turn or budget cap the loop runs to completion without a human in it.

Without limits, the loop runs until Claude finishes on its own, which is fine for well-scoped tasks but can run long on open-ended prompts ("improve…

code.claude.com/docs/en/agent-sdk/agent…Checked

How much it does unattendedYes

Multi-agent

A parent agent can define specialized subagents, run independent tasks concurrently, and receive their reports.

Subagents are separate agent instances that your main agent can spawn to handle focused subtasks.

code.claude.com/docs/en/agent-sdk/subag…Checked

How much it does unattendedYes

Agent permissions

Applications can combine modes, allow and deny rules, hooks, and a runtime approval callback.

Use permission modes and rules to define what's allowed automatically, and the canUseTool callback to handle everything else at runtime.

code.claude.com/docs/en/agent-sdk/permi…Checked

Which models it runs onYes

Claude

Claude is the only model family; you can pin a specific Claude model per session.

Set it explicitly (for example, model="claude-sonnet-5") to pin a specific model or to use a smaller model for faster, cheaper agents.

code.claude.com/docs/en/agent-sdk/agent…Checked

Which models it runs onNo

GPT

Every documented model path is a Claude endpoint: the Anthropic API or a cloud provider's Claude endpoint.

The SDK needs outbound HTTPS to api.anthropic.com, or to your provider's regional endpoint when running on Amazon Bedrock or Google Cloud's Agent…

code.claude.com/docs/en/agent-sdk/hosti…Checked

Which models it runs onNo

Open models

The enumerated model aliases are all Claude models; no open-weight option appears anywhere in the option reference.

Accepts an alias such as 'fable', 'opus', 'sonnet', 'haiku', 'inherit', or a full model ID.

code.claude.com/docs/en/agent-sdk/subag…Checked

Which models it runs onYes

Model choice

Developers can override a subagent’s model with a Claude alias or a full model identifier.

On the page: AgentDefinition configuration table, model field

code.claude.com/docs/en/agent-sdk/subag…Checked

Where you use itNo

In your editor

The SDK ships as a library you embed; the editor and terminal surfaces belong to Claude Code, which the same table routes interactive work to.

The SDK is available as a library for Python and TypeScript only.

code.claude.com/docs/en/agent-sdk/overv…Checked

Where you use itYes

On the command line

claude -p is documented as the SDK's CLI surface, with JSON and stream-JSON output for scripted callers.

It's available as a CLI for scripts and CI/CD, or as Python and TypeScript packages for full programmatic control.

code.claude.com/docs/en/headlessChecked

Where you use itYes

In your pipeline

Bare mode exists for CI reproducibility, and exit codes plus init-event fields let a pipeline fail on a bad run.

Bare mode is useful for CI and scripts where you need the same result on every machine.

code.claude.com/docs/en/headlessChecked

Where you use itNo

In a browser

You host the SDK yourself; the hosted surface is Managed Agents, which the vendor names as a separate product.

Hosted REST API, a separate product from the Agent SDK. Anthropic runs the agent and the sandbox.

code.claude.com/docs/en/agent-sdk/overv…Checked

Whose machine it runs onYes

Self-hosted

The SDK is documented for production deployment on infrastructure operated by the application developer.

This page covers self-hosting on your own infrastructure.

code.claude.com/docs/en/agent-sdk/hosti…Checked

Whose machine it runs onNo

Open source

The product is governed by Anthropic commercial terms rather than an open-source license stated in its documentation.

Use of the Claude Agent SDK is governed by Anthropic's Commercial Terms of Service.

code.claude.com/docs/en/agent-sdkChecked

Whose machine it runs onYes

Licence

Proprietary; Anthropic’s commercial terms expressly cover using the SDK in products and services for customers.

Use of the Claude Agent SDK is governed by Anthropic's Commercial Terms of Service, including when you use it to power products and services that you…

code.claude.com/docs/en/agent-sdkChecked

Building with itYes

SDK languages

The documented SDK offers first-party libraries in Python and TypeScript, with no other languages named here.

The Agent SDK gives you the same tools, agent loop, and context management that power Claude Code, programmable in Python and TypeScript.

code.claude.com/docs/en/agent-sdkChecked

Building with itYes

Tracing and evals

The SDK exports OpenTelemetry traces, metrics, and log events to compatible hosted or self-hosted backends.

The Agent SDK can export this data as OpenTelemetry traces, metrics, and log events to any backend that accepts the OpenTelemetry Protocol (OTLP).

code.claude.com/docs/en/agent-sdk/obser…Checked

What it costs to runYes

How it meters

API use is metered by model token consumption, while session cost estimates are calculated from token counts.

Claude Code charges by API token consumption.

code.claude.com/docs/en/costsChecked

What it costs to runPartly

Price per vCPU-hour

$0.05 an active CPU-hour on Code execution: it bills CPU time while working, not wall-clock vCPU time, so it does not compare directly.

Code execution Run Python code in a sandboxed environment for advanced data analysis. 50 free hours of usage daily per organization. Additional hours…

claude.com/pricingChecked

What it costs to runYes

Price per 1,000 requests

$10 per 1,000 requests in Web search, its cheapest mode.

Web search Give Claude access to the latest information from the web. Doesn’t include input and output tokens required to process requests. Cost $10…

claude.com/pricingChecked

What it costs to runYes

Free tier

A developer can create an Anthropic account, obtain an API key, and start without contacting sales.

Get an API key from the Claude Console, then set it as an environment variable in the shell where you'll run your agent:

code.claude.com/docs/en/agent-sdk/quick…Checked

What it costs to runYes

API access

The product is itself a library for your stack, in Python or TypeScript, with a CLI fallback for other languages.

A library that runs the agent loop in your own process, in Python or TypeScript.

code.claude.com/docs/en/agent-sdk/overv…Checked

What it costs to runPartly

MCP server

The agent is a full MCP client over stdio, HTTP/SSE and in-process servers; the docs describe no way to expose your agent as an MCP server another agent could query.

MCP servers can run as local processes, connect over HTTP, or execute directly within your SDK application.

code.claude.com/docs/en/agent-sdk/mcpChecked

What it costs to runYes

Bring your own key

Applications authenticate using their own Anthropic API key supplied through the process environment.

The SDK reads the key from the environment of the process that runs your agent; it doesn't load .env files automatically.

code.claude.com/docs/en/agent-sdk/quick…Checked

Buying it for a teamYes

A company can buy it

Organizations can use the Claude Console as an API-first, pay-as-you-go route for Agent SDK workloads.

Claude Console | You're API-first or want pay-as-you-go billing

code.claude.com/docs/en/admin-setupChecked

Buying it for a teamNo

Seat model

The API the Agent SDK runs on is sold per token, not per seat: the pricing page's API tab lists only per-MTok model rates and per-use feature rates, with no seat price, seat floor or seat ceiling anywhere in it, and the per-seat figures on the page belong to the Claude chat subscriptions instead.

Fable 5.1 ... Input $10 / MTok Output $50 / MTok ... Managed Agents ... Cost $0.08 per session-hour for active runtime ... Web search ... Cost $10 /…

claude.com/pricingChecked

Buying it for a teamYes

Pooled budget

One organization funds every key, with per-workspace monthly spend caps and alerts; the SDK also accepts a per-query maxBudgetUsd.

Use workspaces to separate different projects, environments, or teams while maintaining centralized billing and administration.

platform.claude.com/docs/en/manage-clau…Checked

Buying it for a teamYes

Admin controls

Organizations can enforce policies controlling tools, commands, MCP servers, and network destinations ahead of local settings.

Claude Code enforces organization policy through managed settings that take precedence over local developer configuration.

code.claude.com/docs/en/admin-setupChecked

Buying it for a teamYes

Audit log

OpenTelemetry can emit tool decisions, tool results, safety events, MCP connections, and permission mode changes.

These events become a per-user audit trail you can forward to a Security Information and Event Management (SIEM) platform:

code.claude.com/docs/en/agent-sdk/obser…Checked

Buying it for a teamYes

Single sign-on

SSO is configured at the Claude account level, although this documentation does not name a protocol.

SSO, SCIM provisioning, and seat assignment are configured at the Claude account level.

code.claude.com/docs/en/admin-setupChecked

What happens to your codeYes

Opt out of training

Anthropic states that code and prompts on Team, Enterprise, API, and cloud-provider plans are not used for training.

On Team, Enterprise, Claude API, and cloud provider plans, Anthropic doesn't train models on your code or prompts.

code.claude.com/docs/en/admin-setupChecked

What happens to your codePartly

Data residency

First-party API inference is global by default, with a US-only inference option for supported newer models.

Global routing (the default) uses standard pricing.

platform.claude.com/docs/en/about-claud…Checked

What happens to your codePartly

Getting out

Session transcripts are written automatically to local disk and can be mirrored to shared storage, while credit-expiry terms are not stated here.

The SDK writes it to disk automatically so you can return to it later.

code.claude.com/docs/en/agent-sdk/sessi…Checked

What happens to your codeYes

Certifications

Anthropic directs users to its Trust Center for SOC 2 Type 2 and ISO 27001 compliance materials.

Learn more and access resources (SOC 2 Type 2 report, ISO 27001 certificate, etc.) at Anthropic Trust Center.

code.claude.com/docs/en/securityChecked

Claude Agent SDK price and terms

What needs a higher plan

Claude Enterprise
Single sign-on

For AI agents

MCP server
Partly
API
Yes

Developer docs

Claude Agent SDK's pricing page

Pricing page, captured

platform.claude.com/docs/en/about-claude/pricing, checked

Claude Agent SDK alternatives

All 9 alternatives

Questions about Claude Agent SDK

How much does Claude Agent SDK cost?
Claude Agent SDK costs $0.10 per 1m input tokens. From platform.claude.com/docs/en/about-claude/pricing, checked 29 October 2026.
Does Claude Agent SDK have an API or an MCP server?
It has an API. It has a limited MCP server.
Is Claude Agent SDK open source, and can you host it yourself?
It is not open source. You can host it yourself.
What have we checked on Claude Agent SDK?
39 facts, under these headings: What it does, how much it does unattended, which models it runs on, where you use it, whose machine it runs on, building with it, what it costs to run, buying it for a team, what happens to your code.
How do we check Claude Agent SDK?
We hold 39 facts on Claude Agent SDK, quoted from 28 pages. Facts and price last checked 29 October 2026. Last change found 18 October 2026.

How we check every listing

Is this yours?

AI assistants like ChatGPT and Claude opened The Agents Index pages 2,746 times in September. Claiming is free. You get this page's reader numbers and the verified owner mark. You confirm it with an email at code.claude.com.

Report an error if a fact is wrong.