Skip to main content
POST
Anthropic
Anthropic Claude models cover coding, long-horizon agents, research, vision, and knowledge work. The playground on this page uses Anthropic Messages, which every Claude model supports.

Models

  • claude-opus-5-5 — Claude Opus 5.5.
  • claude-sonnet-5-5 — Claude Sonnet 5.5.
  • claude-haiku-5-5 — Claude Haiku 5.5, a compact model for classification, extraction, summaries, and subagents, with a 1M-token context.
  • claude-fable-5-1 — Claude Fable 5.1, for long-horizon coding, research, and vision, with 1M context and up to 128K output.
  • claude-opus-5 — Claude Opus 5, for advanced coding, computer use, and deep research.
  • claude-sonnet-5 — Claude Sonnet 5, for agentic coding and browser or computer use, with 1M context and up to 128K output.
  • claude-opus-4-8 — Claude Opus 4.8, with 1M context and up to 128K output.
  • claude-opus-4-7 — Claude Opus 4.7, for coding, deep reasoning, and high-resolution vision.
  • claude-opus-4-6 — Claude Opus 4.6.
  • claude-sonnet-4-6 — Claude Sonnet 4.6.
  • claude-opus-4-5-20251101 — Claude Opus 4.5.
  • claude-sonnet-4-5-20250929 — Claude Sonnet 4.5.
  • claude-haiku-4-5-20251001 — Claude Haiku 4.5.
Every Claude model supports Anthropic Messages and Chat Completions.

Examples

  • Basic Claude message — single user message with max_tokens.
For streaming, extended thinking, and tool use, see the examples on Anthropic Messages. To call a model with the Chat Completions format, send the same model id to Chat Completions.

Notes

  • See LLM Models for every model and the formats it supports.

Authorizations

x-api-key
string
header
required

API key for authentication.

Visit the API Key Management Page to get your API Key

Add to the request header:

Body

application/json
model
enum<string>
default:claude-sonnet-4-5-20250929
required

Anthropic Claude model id.

Available options:
claude-opus-5-5,
claude-sonnet-5-5,
claude-haiku-5-5,
claude-fable-5-1,
claude-opus-5,
claude-sonnet-5,
claude-opus-4-8,
claude-opus-4-7,
claude-opus-4-6,
claude-sonnet-4-6,
claude-opus-4-5-20251101,
claude-sonnet-4-5-20250929,
claude-haiku-4-5-20251001
messages
object[]
required

List of conversation messages in order. Each message contains a role and content. Use user for user input and assistant for previous model output in multi-turn conversations. Example: [{"role": "user", "content": "Summarize the purpose of feature canary releases in two sentences."}].

max_tokens
integer

Maximum number of tokens to generate.

Required range: x >= 1
Example:

1024

system

System prompt for the assistant. Supports a string or structured text blocks.

Example:

"You are a product announcement editor, keep it objective and concise."

cache_control
object

Top-level cache control automatically applies a cache_control marker to the last cacheable block in the request.

stream
boolean

Whether to use streaming output.

Example:

false

stop_sequences
string[]

Stop sequences. The model stops when it encounters any of these strings.

metadata
object

Additional metadata such as user_id.

output_config
object

Configuration options for the model's output, such as output format and effort level.

thinking
object

Configuration for Claude extended thinking. Supported on Claude models with extended thinking. Thinking tokens count toward max_tokens.

tools
object[]

Tool definitions available to the model.

tool_choice

Controls tool usage behavior. Examples: auto, or an object such as {"type": "tool", "name": "get_weather"}.

Example:

"auto"

Response

Message created

id
string
Example:

"msg_013zva2CMHNLnXJNN3QKQ2EF"

type
string
Example:

"message"

role
string
Example:

"assistant"

content
object[]
model
string
Example:

"claude-sonnet-4-5-20250929"

stop_reason
string
Example:

"end_turn"

stop_sequence
string | null
usage
object