[metadata]
apple-mobile-web-app-status-bar-style: default
description: Understand the Claude API's available endpoints, authentication headers, client SDKs, pagination, rate limits, and cloud platform access options.
mobile-web-app-capable: yes
og:description: Understand the Claude API's available endpoints, authentication headers, client SDKs, pagination, rate limits, and cloud platform access options.
og:image: https://platform.claude.com/docs/og?locale=en&path=api/overview&design-rev=1
og:image:alt: API overview
og:image:height: 630
og:image:type: image/png
og:image:width: 1200
og:locale: en
og:site_name: Claude Platform Docs
og:title: API overview
og:type: article
og:url: https://platform.claude.com/docs/en/api/overview
twitter:card: summary_large_image
twitter:description: Understand the Claude API's available endpoints, authentication headers, client SDKs, pagination, rate limits, and cloud platform access options.
twitter:image: https://platform.claude.com/docs/og?locale=en&path=api/overview&design-rev=1
twitter:title: API overview
viewport: width=device-width, initial-scale=1, maximum-scale=1, viewport-fit=cover

[canonical-links]
https://platform.claude.com/docs/en/api/overview

[document-links]
AI agents: https://claude.com/solutions/agents
API key: /settings/keys
API versions: /docs/en/api/versioning
Account Settings: https://platform.claude.com/settings/keys
Admin API: /docs/en/manage-claude/admin-api
Admin: /docs/en/api/admin
Admin: /docs/en/manage-claude/admin-api
Agents API: /docs/en/managed-agents/agent-setup
Anthropic: https://www.anthropic.com/company
Archive Tunnel: /docs/en/api/beta/tunnels/archive
Archive a Dream: /docs/en/api/beta/dreams/archive
Authentication: /docs/en/manage-claude/authentication
Availability: https://www.anthropic.com/supported-countries
Best practices: /docs/en/about-claude/use-case-guides/overview
Beta headers: /docs/en/api/beta-headers
Billing: /settings/billing
Blog: https://claude.com/blog
CLI, SDKs, and libraries: /docs/en/cli-sdks-libraries/overview
Cancel a Dream: /docs/en/api/beta/dreams/cancel
Careers: https://www.anthropic.com/careers
Claude API skill: /docs/en/agents-and-tools/agent-skills/claude-api-skill
Claude Console account: https://platform.claude.com
Claude Managed Agents quickstart: /docs/en/managed-agents/quickstart
Claude Managed Agents reference: /docs/en/managed-agents/sessions
Claude Platform Docs: /docs
Claude Platform Docs: /docs/en/home
Claude Platform on AWS: /docs/en/build-with-claude/claude-platform-on-aws
Claude in Amazon Bedrock: /docs/en/build-with-claude/claude-in-amazon-bedrock
Claude in Microsoft Foundry: /docs/en/build-with-claude/claude-in-microsoft-foundry
Claude on AWS: https://claude.com/partners/amazon-bedrock
Claude on Google Cloud: /docs/en/build-with-claude/claude-on-vertex-ai
Claude on Google Cloud: https://claude.com/partners/google-cloud-vertex-ai
Client SDKs: /docs/en/cli-sdks-libraries/overview
Code modernization: https://claude.com/solutions/code-modernization
Coding: https://claude.com/solutions/coding
Completions: /docs/en/api/completions
Compliance API: /docs/en/api/compliance
Connectors: https://claude.com/partners/mcp
Console: https://platform.claude.com/
Count tokens in a Message: /docs/en/api/beta/messages/count_tokens
Courses: https://claude.com/resources/courses
Create Enrollment URL: /docs/en/api/beta/user_profiles/create_enrollment_url
Create Skill: /docs/en/api/beta/skills/create
Create Tunnel: /docs/en/api/beta/tunnels/create
Create User Profile: /docs/en/api/beta/user_profiles/create
Create a Dream: /docs/en/api/beta/dreams/create
Create a Message: /docs/en/api/beta/messages/create
Create a Text Completion: /docs/en/api/completions/create
Customer stories: https://claude.com/customers
Customer support: https://claude.com/solutions/customer-support
Delete File: /docs/en/api/beta/files/delete
Delete Skill: /docs/en/api/beta/skills/delete
Discord: https://www.anthropic.com/discord
Download File: /docs/en/api/beta/files/download
Dreams : /docs/en/api/beta/dreams
Economic Futures: https://www.anthropic.com/economic-futures
Engineering at Anthropic: https://www.anthropic.com/engineering
Environments API: /docs/en/managed-agents/environments
Errors: /docs/en/api/errors
Events: https://www.anthropic.com/events
Features overview: /docs/en/api/overview
Features overview: /docs/en/build-with-claude/overview
Files API: /docs/en/api/beta/files/upload
Files API: /docs/en/build-with-claude/files
Files : /docs/en/api/beta/files
Financial services: https://claude.com/solutions/financial-services
Get File Metadata: /docs/en/api/beta/files/retrieve_metadata
Get Skill: /docs/en/api/beta/skills/retrieve
Get Tunnel: /docs/en/api/beta/tunnels/retrieve
Get User Profile: /docs/en/api/beta/user_profiles/retrieve
Get a Dream: /docs/en/api/beta/dreams/retrieve
Get a Model: /docs/en/api/beta/models/retrieve
Get started: /docs/en/get-started
Government: https://claude.com/solutions/government
Higher education: https://claude.com/solutions/education
IAM actions (Claude Platform on AWS): /docs/en/api/claude-platform-on-aws-iam-actions
IP addresses: /docs/en/api/ip-addresses
K-12 teachers: https://claude.com/solutions/teachers
Life sciences: https://claude.com/solutions/life-sciences
List Dreams: /docs/en/api/beta/dreams/list
List Files: /docs/en/api/beta/files/list
List Models: /docs/en/api/beta/models/list
List Skills: /docs/en/api/beta/skills/list
List Tunnels: /docs/en/api/beta/tunnels/list
List User Profiles: /docs/en/api/beta/user_profiles/list
Listing sessions: /docs/en/managed-agents/session-operations#listing-sessions
Log in: /login?returnTo=%2Fdocs%2Fen%2Fapi%2Foverview
Managed Agents: /docs/en/managed-agents/overview
Message Batches API: /docs/en/api/messages/batches/create
Message Batches API: /docs/en/build-with-claude/batch-processing
Messages API reference: /docs/en/api/messages/create
Messages API: /docs/en/api/messages/create
Messages: /docs/en/api/beta/messages
Messages: /docs/en/intro
Microsoft Foundry: /docs/en/build-with-claude/claude-in-microsoft-foundry
Models & pricing: /docs/en/about-claude/models/overview
Models API: /docs/en/api/models/list
Models: /docs/en/api/beta/models
News: https://www.anthropic.com/news
Powered by Claude: https://claude.com/partners/powered-by-claude
Privacy policy: https://www.anthropic.com/legal/privacy
Rate limits: /docs/en/api/rate-limits
Rate limits: /settings/limits
Release notes: /docs/en/release-notes/overview
Request IDs: /docs/en/build-with-claude/claude-platform-on-aws#request-ids
Research: https://www.anthropic.com/research
Responsible Scaling Policy: https://www.anthropic.com/news/announcing-our-updated-responsible-scaling-policy
Responsible disclosure policy: https://www.anthropic.com/responsible-disclosure-policy
Reveal Tunnel Token: /docs/en/api/beta/tunnels/reveal_token
Rotate Tunnel Token: /docs/en/api/beta/tunnels/rotate_token
Security and compliance: https://trust.anthropic.com
Service partners: https://claude.com/partners/services
Service tiers: /docs/en/api/service-tiers
Sessions API: /docs/en/managed-agents/sessions
Skills API: /docs/en/api/skills/create-skill
Skills : /docs/en/api/beta/skills
Startups program: https://claude.com/programs/startups
Status: https://status.claude.com/
Support: https://support.claude.com/
Supported regions: /docs/en/api/supported-regions
Terms of service: Commercial: https://www.anthropic.com/legal/commercial-terms
Terms of service: Consumer: https://www.anthropic.com/legal/consumer-terms
Token Counting API: /docs/en/api/messages-count-tokens
Transparency: https://www.anthropic.com/transparency
Trigger a routine: /docs/en/api/claude-code/routines-fire
Tunnels : /docs/en/api/beta/tunnels
Update User Profile: /docs/en/api/beta/user_profiles/update
Upload File: /docs/en/api/beta/files/upload
Usage policy: https://www.anthropic.com/legal/aup
Use cases: https://claude.com/resources/use-cases
User Profiles : /docs/en/api/beta/user_profiles
Versions: /docs/en/api/versioning
Webhooks : /docs/en/api/beta/webhooks
Workbench: https://platform.claude.com/playground
Working with Messages: /docs/en/build-with-claude/working-with-messages
Workload Identity Federation: /docs/en/manage-claude/workload-identity-federation
client SDKs: /docs/en/cli-sdks-libraries/overview
control spend: /docs/en/api/rate-limits
expiration: /docs/en/manage-claude/authentication#key-expiration
https://instagram.com/claudeai
https://www.linkedin.com/showcase/claude
https://www.threads.com/@claudeai
https://www.youtube.com/@anthropic-ai
https://x.com/claudeai
many countries and regions: /docs/en/api/supported-regions
workspaces: https://platform.claude.com/settings/workspaces
 API reference: /docs/en/api/overview
 Console: /
 Log in: /login

[content]
API overview - Claude Platform Docs
Claude Platform Docs
Messages
Managed Agents
Admin
Resources

Best practices
Models & pricing
CLI, SDKs, and libraries
Claude API skill
Release notes

API reference
English


Console
Log in



Search
⌘K

Include beta APIs
Using the API
Features overview
Beta headers
Errors
Messages
Create a Message
Count tokens in a Message
Batches

Managed Agents

Agents

Environments

Sessions

Deployments

Deployment Runs

Vaults

Memory Stores

Models
List Models
Get a Model
Dreams

Create a Dream
List Dreams
Get a Dream
Cancel a Dream
Archive a Dream
Files

Upload File
List Files
Download File
Get File Metadata
Delete File
Skills

Create Skill
List Skills
Get Skill
Delete Skill
Versions

Tunnels

Create Tunnel
Get Tunnel
List Tunnels
Archive Tunnel
Reveal Tunnel Token
Rotate Tunnel Token
Certificates

User Profiles

Create User Profile
List User Profiles
Get User Profile
Update User Profile
Create Enrollment URL
Webhooks

Admin
Organizations

Invites

Users

RBAC Groups


RBAC Roles


Workspaces

API Keys

External Keys

Usage Report

Cost Report

Analytics

Spend Limits

Rate Limits

Service Accounts

Federation Issuers

Federation Rules

MCP Tunnels


Compliance API
Activities

Organizations

Groups

Apps

Code

Completions
Create a Text Completion
Claude Code
Trigger a routine
Support & configuration
Rate limits
Service tiers
IAM actions (Claude Platform on AWS)
Versions
IP addresses
Supported regions

Log in

API reference

Features overview
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Claude Platform Docs
Solutions
AI agents
Code modernization
Coding
Customer support
Financial services
Government
Higher education
K-12 teachers
Life sciences
Partners
Claude on AWS
Claude on Google Cloud
Learn
Blog
Courses
Use cases
Connectors
Customer stories
Engineering at Anthropic
Events
Powered by Claude
Service partners
Startups program
Company
Anthropic
Careers
Economic Futures
Research
News
Responsible Scaling Policy
Security and compliance
Transparency
Learn
Blog
Courses
Use cases
Connectors
Customer stories
Engineering at Anthropic
Events
Powered by Claude
Service partners
Startups program
Help and security
Availability
Status
Support
Discord
Terms and policies
Privacy policy
Responsible disclosure policy
Terms of service: Commercial
Terms of service: Consumer
Usage policy
API reference
/
Using the API
API overview
Copy page

Understand the Claude API's available endpoints, authentication headers, client SDKs, pagination, rate limits, and cloud platform access options.
Copy page

The Claude API is a RESTful API at
https://api.anthropic.com
that provides programmatic access to Claude models and Claude Managed Agents.

New to Claude?
For direct model access, start with
Get started
and
Working with Messages
. For managed agent infrastructure, see the
Claude Managed Agents quickstart
.

Prerequisites
To use the Claude API, you'll need:
A
Claude Console account
An
API key
, or a configured
Workload Identity Federation
rule
For step-by-step setup instructions, see
Get started
.

Available APIs
The Claude API includes the following APIs:
General Availability:
Messages API
: Send messages to Claude for conversational interactions (
POST /v1/messages
)
Message Batches API
: Process large volumes of Messages requests asynchronously with 50% cost reduction (
POST /v1/messages/batches
)
Token Counting API
: Count tokens in a message before sending to manage costs and rate limits (
POST /v1/messages/count_tokens
)
Models API
: List available Claude models and their details (
GET /v1/models
)
Beta:
Files API
: Upload and manage files for use across multiple API calls (
POST /v1/files
,
GET /v1/files
)
Skills API
: Create and manage custom agent skills (
POST /v1/skills
,
GET /v1/skills
)
Agents API
: Define reusable, versioned agent configurations for Claude Managed Agents (
POST /v1/agents
,
GET /v1/agents
)
Sessions API
: Run stateful agent sessions in managed cloud sandboxes (
POST /v1/sessions
,
GET /v1/sessions/{id}/events/stream
)
Environments API
: Configure sandbox templates for agent sessions (
POST /v1/environments
,
GET /v1/environments
)
For the complete API reference with all endpoints, parameters, and response schemas, explore the API reference pages listed in the navigation. To access beta features, see
Beta headers
.

Authentication
For details on both authentication methods and when to use each, see
Authentication
. All requests to the Claude API must include these headers:
Header
Value
Required
x-api-key
Your API key from Console
One of
x-api-key
or
Authorization
Authorization
Bearer <token>
, where
<token>
is a short-lived access token obtained from
POST /v1/oauth/token
through
Workload Identity Federation
One of
x-api-key
or
Authorization
anthropic-version
API version (for example,
2023-06-01
)
Yes
content-type
application/json
Yes
If you are using the
Client SDKs
, the SDK will send these headers automatically. For API versioning details, see
API versions
.
When accessing Claude through a
cloud platform
, authentication is integrated with the cloud provider's IAM system. See the platform-specific documentation for supported credential types, required headers, and authentication options.

Getting API keys
The API is made available through the web
Console
. You can use the
Workbench
to try out the API in the browser and then generate API keys in
Account Settings
. You choose each key's
expiration
when you create it. Use
workspaces
to segment your API keys and
control spend
by use case.

Client SDKs
Anthropic provides official SDKs that simplify API integration by handling authentication, request formatting, error handling, and more.
Benefits:
Automatic header management (x-api-key, anthropic-version, content-type)
Type-safe request and response handling
Built-in retry logic and error handling
Streaming support
Request timeouts and connection management
For a list of client SDKs, see
Client SDKs
.

Claude API vs cloud platforms
Claude is available through the direct Claude API and through cloud platforms. Choose based on your infrastructure, feature availability, compliance requirements, and pricing preferences.

Claude API
Direct access
to the latest models and features
Anthropic billing and support
Best for:
New integrations, full feature access, direct relationship with Anthropic

Cloud platform APIs
Access Claude through AWS, Google Cloud, or Microsoft Azure:
Integrated
with cloud provider billing and IAM
Feature availability varies by platform:
Anthropic-operated platforms include
Claude Platform on AWS
and
Microsoft Foundry
; partner-operated platforms include Amazon Bedrock and Google Cloud. See each platform's page for feature availability and timing.
Best for:
Existing cloud commitments, specific compliance requirements, consolidated cloud billing
Platform
Provider
Documentation
Agent Platform
Google Cloud
Claude on Google Cloud
Amazon Bedrock
AWS
Claude in Amazon Bedrock
Claude Platform on AWS
AWS (Anthropic-operated)
Claude Platform on AWS
Microsoft Foundry
Microsoft Azure (Anthropic-operated)
Claude in Microsoft Foundry

Claude Managed Agents is available through the direct Claude API and
Claude Platform on AWS
. For feature availability across platforms, see the
Features overview
.

Request and response format

Request size limits
Endpoint
Maximum request size
Messages, Token Counting
32 MB
Message Batches API
256 MB
Files API
500 MB
Sessions, Agents, Environments
32 MB
If you exceed these limits, you'll receive a 413
request_too_large
error.

Partner-operated platforms have their own request size limits: Bedrock limits requests to 20 MB, and Google Cloud limits requests to 30 MB. Claude Platform on AWS uses the same limits as the direct Claude API. Consult your platform's documentation for current values.

Response headers
The Claude API includes the following headers in every response:
request-id
: A globally unique identifier for the request
anthropic-organization-id
: The organization ID associated with the API key used in the request

Claude Platform on AWS adds an AWS request ID (
x-amzn-requestid
) alongside the standard
request-id
header. See
Request IDs
for the dual-ID handling pattern.

Pagination
List endpoints return results in pages. Most newer list endpoints use the
page
and
next_page
cursor scheme described in this section. Some use a different scheme; see the note at the end of this section. Use the
limit
query parameter to control the page size and the
page
query parameter to fetch an adjacent page. Each response includes a
data
array alongside cursor fields for navigating between pages.
Name
Location
Description
limit
Query parameter
Maximum number of items to return per page.
page
Query parameter
Opaque cursor from a previous response. Pass a
next_page
or
prev_page
value here to fetch the adjacent page.
order
Query parameter
Sort direction for the results (
asc
or
desc
), on list endpoints that support sorting. A
page
cursor is only valid with the
order
it was created with.
next_page
Response field
Cursor for the next page, or
null
if there are no more results.
prev_page
Response field
Cursor for the previous page on endpoints that support backward pagination (currently
GET /v1/sessions
), or
null
if you are on the first page. Other list endpoints omit the field.
To go back a page, pass
prev_page
as the
page
parameter.
prev_page
is
null
when you're on the first page. Not all list endpoints support
prev_page
. Only
GET /v1/sessions
returns
prev_page
; on list endpoints that do not support backward pagination, the field is absent from the response rather than
null
. For a request walkthrough, see
Listing sessions
.
Every SDK provides an auto-paginating iterator that follows
next_page
for you. In Python and TypeScript, you get it by iterating the list result directly. The other SDKs provide the iterator through a separate method. SDK auto-pagination is forward-only; to go back a page, read
prev_page
from the response and pass it back as the
page
parameter yourself. See
client SDKs
for language-specific details.

Some list endpoints use a different cursor scheme. The
Message Batches API
, the
Files API
, the
Models API
, and several
Admin API
endpoints take
after_id
and
before_id
query parameters instead of
page
. Their responses return
has_more
,
first_id
, and
last_id
instead of
next_page
. Some endpoints that use the
page
scheme, such as
GET /v1/skills
, also return a
has_more
Boolean alongside
next_page
. See the reference page for each endpoint for its exact pagination fields.

Rate limits and availability

Rate limits
The API enforces rate limits and spend limits to prevent misuse and manage capacity. Limits are organized into usage tiers; your organization is placed on a tier automatically and can move to a higher tier over time. Each tier has:
Spend limits
: Maximum monthly cost for API usage
Rate limits
: Maximum number of requests per minute (RPM) and tokens per minute (TPM)
You can view your rate limits on the
Rate limits
page and your spend limits on the
Billing
page in the Console. For higher rate limits or a higher monthly spend cap, use
Request rate limit increase
on the Rate limits page.
For detailed information about limits, tiers, and the token bucket algorithm used for rate limiting, see
Rate limits
.

Availability
The Claude API is available in
many countries and regions
worldwide. Check the supported regions page to confirm availability in your location.

Next steps

Messages API reference
Complete API specification for direct model interactions
Claude Managed Agents reference
Agents, Sessions, and Environments endpoints

Client SDKs
Python, TypeScript, C#, Go, Java, PHP, and Ruby
Rate limits
Usage tiers, requesting higher limits, and the token bucket algorithm
Was this page helpful?


Prerequisites
Available APIs
Authentication
Getting API keys
Client SDKs
Claude API vs cloud platforms
Claude API
Cloud platform APIs
Request and response format
Request size limits
Response headers
Pagination
Rate limits and availability
Rate limits
Availability
Next steps
