v1
latestOpenAPI 3.1.02026-07-267724480.0 KBAnthropic Messages
Send structured messages to Claude models using the Anthropic native API format. Supports text and multimodal inputs, multi-turn conversations, adaptive thinking, tool use, prompt caching, streaming, and web search. Use this endpoint when you need Claude-specific features like adaptive thinking or prompt caching that are not available through the OpenAI-compatible endpoint.
post/v1/messages
Headers
anthropic-versionstring
Example:2023-06-01
The Anthropic API version to use. Defaults to 2023-06-01.
anthropic-betastring
Comma-separated list of beta features to enable. Examples: max-tokens-3-5-sonnet-2024-07-15, pdfs-2024-09-25, output-128k-2025-02-19.
Request body
Example request
{
"model": "claude-sonnet-5",
"max_tokens": 1024,
"temperature": 1,
"top_p": 1,
"output_config": {
"effort": "medium"
}
}Response
Successful response. When stream is true, the response is a stream of SSE events.