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)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.
All requests to the Claude API must include these headers:
| Header | Value | Required |
|---|---|---|
x-api-key | Your API key from Console | Yes |
anthropic-version | API version (e.g., 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.
The API is made available via 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 partner platforms. Choose based on your infrastructure, compliance requirements, and pricing preferences.
Access Claude through AWS, Google Cloud, or Microsoft Azure:
| Platform | Provider | Documentation |
|---|---|---|
| Amazon Bedrock | AWS | Claude in Amazon Bedrock |
| Vertex AI | Google Cloud | Claude on Vertex AI |
| Azure AI | Microsoft Azure | Claude on Azure AI |
Claude Managed Agents is available only through the direct Claude API. For feature availability across platforms, see the Features overview.
| Endpoint | Maximum request size |
|---|---|
| Messages, Token Counting | 32 MB |
| Batch 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.
Third-party platforms have their own request size limits: Vertex AI limits requests to 30 MB, and Amazon Bedrock limits requests to 20 MB. 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 requestThe 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
Agents, Sessions, and Environments endpoints
Python, TypeScript, Java, Go, C#, Ruby, and PHP
Usage tiers, spend limits, and token bucket algorithm
Was this page helpful?