Anthropic Messages
Anthropic-compatible Messages endpoint at /v1/messages.
/v1/messages accepts Anthropic Messages API payloads and returns Anthropic-formatted responses.
Streaming
Setstream: true to receive server-sent events in Anthropic format (message_start, content_block_*, message_delta, message_stop).
Notes
- Anthropic tool-use fields are supported.
stream: truealso works with tool loops. For gateway-managed server tools, AI Stats may materialize the upstream tool-call turn, continue the loop, and re-emit a synthetic stream.- The Anthropic-native web search tool shape is also accepted directly in
tools, for exampletype: "web_search_20250305". - The
X-AIStats-Strictnessheader controls how unsupported parameters are handled.
Server tools
/v1/messages also supports these gateway-managed server tools:
gateway:datetimeai-stats:web_searchai-stats:web_fetchai-stats:advisorai-stats:image_generation
Native provider web search
When a compatible Anthropic model/provider pair supports native web search, you can also pass the native tool definition through directly:web_search_options support before execution.
Datetime example
usage.server_tool_use.* counters report server-tool invocations.Authorizations
Bearer token authentication
Body
1x >= 10 <= x <= 10 <= x <= 1x >= 1Anthropic-compatible tools plus gateway server tools. The only built-in gateway server tools are gateway:datetime, gateway:web_search, and gateway:web_fetch.
- Option 1
- Option 2
- Option 3
- Option 4
Anthropic tool choice object/string. gateway:datetime, gateway:web_search, and gateway:web_fetch are also accepted and rewritten by the gateway.
Unique identifier for grouping related requests (for example, a conversation or agent workflow) for observability.
256OpenAI-compatible prompt cache retention policy, such as 24h.
Provider-neutral prompt cache control hint for automatic caching or cache breakpoints.
Optional provider-specific options.
Gateway debug controls. These flags are never forwarded upstream.
Provider routing preferences for gateway selection.