POST Messages

Anthropic Messages (Claude Code protocol)

Anthropic's Messages protocol, for Claude Code (`ANTHROPIC_BASE_URL=https://api.aiduct.ai`, no `/v1`) and the Anthropic SDKs. Every catalog chat model answers here: Claude models natively, others translated, with tool use, thinking and images kept. Authenticate with `x-api-key` or `Authorization: Bearer`; `anthropic-version` and `anthropic-beta` reach a natively served model. Set `stream: true` for Anthropic's `event: <type>` SSE stream. Errors use Anthropic's envelope. `usage` counts `input_tokens` without the cache, beside `cache_read_input_tokens` and `cache_creation_input_tokens`.

Endpoint

post/v1/messages

Responses

200

Anthropic Messages response (non-stream) or `event: <type>` SSE stream when `stream: true`

400

Invalid request