Anthropic's Claude API: message-based shape, XML-friendly, strong at long-context and following complex instructions. Extended thinking (reasoning) as of Claude 3.7+. The provider of choice for teams doing document-heavy or coding-heavy work.
- 01State the Claude message structure.
- 02Explain how extended thinking differs from OpenAI reasoning models.
- 03Recognize Claude-specific idioms (XML, cache_control).
The API
messages endpoint takes a list of role/content messages, plus an optional system message (separate parameter, not a role). Supports tool use, streaming, and vision. Prompt caching via cache_control blocks yields 90% cost reduction on repeated context.
Extended thinking
Claude 3.7+ supports 'thinking' — the model produces internal reasoning tokens visible to you before its answer. Enable with a thinking parameter. Trades latency and tokens for accuracy on hard tasks, in the same spirit as OpenAI's o-series.
- Claude's system prompt is a separate parameter, not a role.
- Prompt caching is the largest cost-reduction lever on Anthropic.