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.
To use the Claude API, you'll need:
For step-by-step setup instructions, see Get started.
The Claude API includes the following APIs:
General Availability:
POST /v1/messages)POST /v1/messages/batches)POST /v1/messages/count_tokens)GET /v1/models)Beta:
POST /v1/files, GET /v1/files)POST /v1/skills, GET /v1/skills)POST /v1/agents, GET /v1/agents)POST /v1/sessions, GET /v1/sessions/{id}/stream)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.
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 via Workload Identity Federation | One of x-api-key or Authorization |
anthropic-version | API version (e.g., 2023-06-01) | 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.
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. Use workspaces to segment your API keys and control spend by use case.
Anthropic provides official SDKs that simplify API integration by handling authentication, request formatting, error handling, and more.
Benefits:
For a list of client SDKs and their respective installation instructions, see Client SDKs.
Claude is available through the direct Claude API and through cloud platforms. Choose based on your infrastructure, feature availability, compliance requirements, and pricing preferences.
Access Claude through AWS, Google Cloud, or Microsoft Azure:
| Platform | Provider | Documentation |
|---|---|---|
| Claude Platform on AWS | AWS (Anthropic-operated) | Claude Platform on AWS |
| Amazon Bedrock | AWS | Claude in Amazon Bedrock |
| Vertex AI | Google Cloud | Claude on Vertex AI |
| 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.
| 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: Vertex AI limits requests to 30 MB, and Bedrock limits requests to 20 MB. Claude Platform on AWS uses the same limits as the direct Claude API. Consult your platform's documentation for current values.
The Claude API includes the following headers in every response:
request-id: A globally unique identifier for the requestanthropic-organization-id: The organization ID associated with the API key used in the requestClaude 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.
The API enforces rate limits and spend limits to prevent misuse and manage capacity. Limits are organized into usage tiers that increase automatically as you use the API. Each tier has:
You can view your organization's current limits in the Console. For higher limits or Priority Tier (enhanced service levels with committed spend), contact sales through the Console.
For detailed information about limits, tiers, and the token bucket algorithm used for rate limiting, see Rate limits.
The Claude API is available in many countries and regions worldwide. Check the supported regions page to confirm availability in your location.
Complete API specification for direct model interactions
Was this page helpful?
POST /v1/environmentsGET /v1/environmentscontent-type |
application/json |
| Yes |
Agents, Sessions, and Environments endpoints