What is the Claude API?

The Claude API gives developers programmatic access to Claude, Anthropic’s AI assistant — through a simple REST interface. Instead of interacting with Claude through a chat interface, you send structured HTTP requests and receive responses your application can process, display, or act on. With the Claude API you can:
  • Generate text, answer questions, and summarize content
  • Build conversational applications with multi-turn context
  • Define tools that Claude can call to access real-time data
  • Stream responses word by word for a natural user experience
  • Shape Claude’s behavior and persona using system prompts

Who This Reference Is For

This reference is written for developers who are integrating the Claude API into their applications. It assumes basic familiarity with REST APIs and JSON, no prior experience with AI or large language models is required. If you are completely new to APIs, Anthropic’s official getting started guide is a good place to begin.

What Makes This Reference Different

This documentation was built by making real API calls, studying actual responses, and documenting behavior that the official docs don’t always cover, including edge cases, token economics, and subtle behaviors discovered through testing. Every code example in this reference was tested against the live API. Every response schema was built from real responses, not assumptions.

How to Use This Reference

Quickstart

Make your first API call in under five minutes

Core Concepts

Understand the messages array, tokens, and context

API Reference

Full endpoint reference with request and response schemas

Guides

Deep dives into system prompts, streaming, tool use, and errors

Base URL

All API requests are made to the following base URL:

Authentication

Every request requires your API key passed as a header:
Never expose your API key in client-side code or public repositories. Store it as an environment variable and reference it server-side only.
Don’t have an API key yet? Get one at the Anthropic Console.

API Versioning

Every request also requires the anthropic-version header:
This header pins your integration to a specific API contract. If Anthropic introduces breaking changes in the future, your integration continues to work exactly as built — because you’ve declared which version of the API you’re building against. 2023-06-01 is the current stable version.