# Claude Agent SDK — Python and TypeScript library that runs Claude Code's agent loop and tools inside your own application.

> Source: The Agents Index — https://theagentsindex.com/claude-agent-sdk (structured, researched, re-verified)
> Facts last verified: 2026-09-02

The Claude Agent SDK is a Python and TypeScript library that embeds Claude Code's agent loop in your own process. You supply the prompt and the hosting; the SDK spawns a Claude Code subprocess and streams back its messages.

| Fact | Value |
| --- | --- |
| Website | https://code.claude.com/docs/en/agent-sdk |
| Price | from $1/million input tokens pay-as-you-go |
| Free tier | Partly |

The npm and PyPI packages install free and Console signup is self-serve, but running an agent bills Anthropic API tokens; the docs publish no free token allowance for the SDK.

## What it does

**Writes code** · Yes — 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.
> — https://code.claude.com/docs/en/agent-sdk/overview · Opening paragraph, first sentence

**Debugs and fixes** · Yes — 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.
> — https://code.claude.com/docs/en/agent-sdk/quickstart · Intro line above 'What you'll do'

**Writes tests** · Yes — 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 running tests
> — https://code.claude.com/docs/en/agent-sdk/agent-loop · The loop at a glance, paragraph after the five steps

**Reviews code** · Yes — 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.
> — https://code.claude.com/docs/en/headless · Examples, 'Add Claude to a build script'

**Whole-codebase work** · Partly — 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.
> — https://code.claude.com/docs/en/agent-sdk/subagents · Benefits of using subagents, Context isolation bullet

**Ships it** · Partly — 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
> — https://code.claude.com/docs/en/agent-sdk/agent-loop · Built-in tools table, Execution row (Bash)

## How much it does unattended

**Runs autonomously** · Yes — 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 this codebase").
> — https://code.claude.com/docs/en/agent-sdk/agent-loop · Turns and messages, limits paragraph

**Multi-agent** · Yes — Subagents are first-class: defined in code or as files, run concurrently, each with its own context and tool subset.

> Parallelization: multiple subagents can run concurrently, so independent subtasks finish in the time of the slowest one rather than the sum of all of them.
> — https://code.claude.com/docs/en/agent-sdk/subagents · Benefits of using subagents, Parallelization bullet

**Agent permissions** · Yes — Six permission modes plus allow/deny rules, hooks and a canUseTool callback, evaluated in a documented six-step order.

> The Claude Agent SDK provides permission controls to manage how Claude uses tools. Use permission modes and rules to define what's allowed automatically
> — https://code.claude.com/docs/en/agent-sdk/permissions · Intro paragraph

## Which models it runs on

**Claude** · Yes — 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.
> — https://code.claude.com/docs/en/agent-sdk/agent-loop · Control how the loop runs, Model section

**GPT** · No — 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 Platform.
> — https://code.claude.com/docs/en/agent-sdk/hosting · Provision the container, Network subsection

**Open models** · No — 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.
> — https://code.claude.com/docs/en/agent-sdk/subagents · AgentDefinition configuration table, model row

**Model choice** · Partly — You choose the model per session and per subagent, but only from Claude models.

> If you don't set model, the SDK uses Claude Code's default, which depends on your authentication method and subscription.
> — https://code.claude.com/docs/en/agent-sdk/agent-loop · Control how the loop runs, Model section

## Where you use it

**In your editor** · No — 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.
> — https://code.claude.com/docs/en/agent-sdk/overview · Paragraph directly below the 'Compare the Agent SDK to other Claude tools' table

**On the command line** · Yes — 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.
> — https://code.claude.com/docs/en/headless · Intro paragraph

**In your pipeline** · Yes — 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.
> — https://code.claude.com/docs/en/headless · Start faster with bare mode

**In a browser** · No — 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.
> — https://code.claude.com/docs/en/agent-sdk/overview · Compare the Agent SDK to other Claude tools table, Managed Agents row

## Whose machine it runs on

**Self-hosted** · Yes — Self-hosting is the default: your process spawns a claude CLI subprocess with your working directory and disk.

> This page covers self-hosting on your own infrastructure.
> — https://code.claude.com/docs/en/agent-sdk/hosting · Intro paragraph

**Open source** · Partly — Use of the SDK is placed under Anthropic's Commercial Terms of Service rather than an open-source licence.

> 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 make available to your own customers and end users
> — https://code.claude.com/docs/en/agent-sdk/overview · License and terms section

## What it costs to run

**How it meters** · Yes — Metered per million tokens against an API key, with cache-write, cache-read and output rates priced separately.

> Claude Haiku 4.5   $1 / MTok   $1.25 / MTok   $2 / MTok   $0.10 / MTok   $5 / MTok
> — https://platform.claude.com/docs/en/about-claude/pricing · Model pricing table, Claude Haiku 4.5 row (base input, 5m cache writes, 1h cache writes, cache hits, output)

**Free tier** · Partly — Signup and key creation are self-serve with no sales call, but every run bills API tokens and no free token allowance is published for the SDK.

> Get an API key from the Claude Console, then set it as an environment variable in the shell where you'll run your agent
> — https://code.claude.com/docs/en/agent-sdk/quickstart · Setup, 'Set your API key' step

**API access** · Yes — 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.
> — https://code.claude.com/docs/en/agent-sdk/overview · Compare the Agent SDK to other Claude tools table, Agent SDK row

**MCP server** · Partly — 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.
> — https://code.claude.com/docs/en/agent-sdk/mcp · Intro paragraph

**Bring your own key** · Yes — Your own Anthropic key, your own proxy via ANTHROPIC_BASE_URL, or your own cloud through Bedrock, Claude Platform on AWS, Google Cloud or Microsoft Foundry.

> the subprocess reads ANTHROPIC_API_KEY from its environment. Supply it from your secret manager, or set ANTHROPIC_BASE_URL to route model calls through a proxy that injects the key
> — https://code.claude.com/docs/en/agent-sdk/hosting · Handle production concerns, Auth and secrets

## Buying it for a team

**A company can buy it** · Yes — Usage is bought through a Console organization with members, roles, invites and workspaces, manageable by hand or through the Admin API.

> To collaborate with teammates and add members, set up your organization in Console → Settings → Organization.
> — https://platform.claude.com/docs/en/manage-claude/admin-api · Tip callout at top of page

**Seat model** · No — Billing is per million tokens on an API key; the docs publish no per-seat price, floor or ceiling for SDK usage.

> Claude Haiku 4.5   $1 / MTok   $1.25 / MTok   $2 / MTok   $0.10 / MTok   $5 / MTok
> — https://platform.claude.com/docs/en/about-claude/pricing · Model pricing table, Claude Haiku 4.5 row

**Pooled budget** · Yes — 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.
> — https://platform.claude.com/docs/en/manage-claude/workspaces · Intro paragraph, 'How workspaces work'

**Admin controls** · Yes — The embedding app sets allow/deny rules, a permission mode and PreToolUse hooks; organization-managed settings can override a subagent's bypassPermissions.

> Organizations can set policies that apply across all users.
> — https://code.claude.com/docs/en/agent-sdk/secure-deployment · Built-in security features, Permissions system bullet

**Audit log** · Partly — Administrative and API actions land in the Compliance API Activity Feed, which Anthropic must enable for the organization; separately the SDK exports per-user tool and permission events over OpenTelemetry.

> The Activity Feed records authentication, chat, file, project, administrative, and platform activity across your organization and returns it in reverse chronological order.
> — https://platform.claude.com/docs/en/manage-claude/compliance-activity-feed · Intro paragraph

**Single sign-on** · Partly — The SDK authenticates with API keys or cloud credentials, never a user login; SSO sign-in and SCIM directory sync exist on the Anthropic organization that owns those keys.

> An identity provider (such as Okta, Microsoft Entra ID, or JumpCloud) pushed a change through SCIM directory sync.
> — https://platform.claude.com/docs/en/manage-claude/compliance-activity-feed · Understand the Activity object, actor table, scim_directory_sync_actor row

## What happens to your code

**Opt out of training** · Yes — Retained API data is not used for training without express permission, and the opt-in route is a named program an admin must join.

> Retained data is never used for model training without your express permission.
> — https://platform.claude.com/docs/en/manage-claude/api-and-data-retention · How Anthropic approaches data retention, first commitment bullet

**Data residency** · Partly — inference_geo pins inference to US infrastructure at a 1.1x token price, and workspace storage geo is currently US-only; no other jurisdiction is offered.

> Inference runs only in US-based infrastructure.
> — https://platform.claude.com/docs/en/manage-claude/data-residency · Inference geo table, "us" row

**Getting out** · Partly — Session transcripts are plain JSONL on your own disk and can be mirrored to S3, Redis or Postgres with a SessionStore adapter; expiry of unused prepaid API credit is not stated in the pages read.

> Claude Code stores sessions under ~/.claude/projects/<encoded-cwd>/*.jsonl.
> — https://code.claude.com/docs/en/agent-sdk/sessions · Use session options with query(), Resume by ID tip

**Certifications** · Yes — SOC 2 Type 2 and ISO 27001 artefacts are published through the Trust Center, and the Claude API offers a self-serve BAA for HIPAA readiness; GDPR is not named on this page.

> Learn more and access resources (SOC 2 Type 2 report, ISO 27001 certificate, etc.) at Anthropic Trust Center.
> — https://code.claude.com/docs/en/security · How we approach security, Security foundation

## Provenance

Every fact above comes from the vendor. Nothing here is independently corroborated yet.

## Coverage elsewhere

Pages about this product that the vendor does not control. The label states how independent each one is.

| Source | Kind | Read |
| --- | --- | --- |
| thenewstack.io | Independent source | 2026-07-30 |

## What changed

- 2026-09-02 — Capabilities · Commercial terms · Free tier · Price
- 2026-08-31 — Capabilities · Commercial terms · Free tier · Price
- 2026-08-18 — What is,tagline,verdict,editor note,pros,cons,key features,why use,limitations,pricing tiers,faq items

## Correcting this record

Anything marked "Not established" is a question we have not answered — it is not a No. If you represent Claude Agent SDK, or anything here is wrong or out of date, you can supply it with a source: the operations this site accepts from an agent are listed at https://theagentsindex.com/.well-known/agents.json — that catalogue needs no key to read, and each entry states its own auth.

Supplying evidence is free. Nothing that can be bought here changes what a field says, whether a gap is closed, or how this record is scored.
