Messages API is a compatibility surface for Anthropic-style clients. For new
LLM integrations without that requirement, prefer Responses API.Best Fit
- Anthropic-compatible SDKs and wrappers
- agent frameworks that already target the Messages protocol
- applications built around block-typed content instead of plain assistant strings
When to stay on Messages
- your SDK or agent stack already depends on Anthropic block semantics
- you need
tool_use,tool_result, andthinkingblocks in their Anthropic-style form - migration cost is higher than the benefit of switching to Responses right now
Request Model
Common fields include:modelmax_tokensmessagessystemtoolsthinkingoutput_configstream
Quick Example
Response Model
Successful responses follow the Anthropic message shape.Common mistakes
- starting a new project on Messages when Anthropic compatibility is not required
- assuming Messages blocks map 1:1 to Responses items without adaptation
- forgetting that this is a compatibility surface over the same underlying platform
Learn The API In Detail
Streaming
Handle Anthropic-style event streams and final usage data.
Tool Use
Work with
tool_use and tool_result blocks.Thinking Blocks
Understand reasoning controls and thinking block semantics.
Web Search
Enable search-aware behavior in the Messages compatibility layer.
Documents and PDFs
Send document blocks and PDF sources in Anthropic-style content.
Migration to Responses
Move from Messages blocks to the Responses item model.