/v1/messages.
Available models
Legacy (still available)
Thinking
Claude can reason internally before the final answer. There are two approaches across generations:- Extended Thinking:
claude-sonnet-4-6andclaude-haiku-4-5set abudget_tokensthinking budget via thethinkingparameter. - Adaptive Thinking:
claude-opus-4-8andclaude-opus-4-7are controlled by theeffortparameter (low/medium/high); Opus 4.8 defaults tohighand no longer usesbudget_tokens.
Enable extended thinking via model ID
Enable via parameter (Claude native protocol)
Tokens produced by thinking and tokens in the final answer are billed separately (thinking_tokens vs. output_tokens), shown distinctly in the console log. Exact parameter support is subject to the console.
Examples
OpenAI-compatible protocol
Claude native SDK
Tool calling
Claude natively supports the three-steptools / tool_use / tool_result tool-calling flow, fully compatible with the official Anthropic protocol.
When accessed via the OpenAI-compatible endpoint, tool calls are automatically converted to OpenAI’s tools / tool_calls structures.
See Function calling.
Vision
Supports image URL and base64 input:Prompt caching
Claude supports marking long context segments withcache_control to hit the prompt cache, with cache hits billed at a lower rate.
OpenPAI passes this field through verbatim — see Cache billing.