Anthropic Messages
Anthropic Messages
Section titled “Anthropic Messages”ProxAI uses the protocol name anthropic_messages for the Anthropic Messages API.
Protocol value
anthropic_messagesRequest path
/v1/messagesMain code areas
src/protocol/anthropic/messages/wiresrc/provider/anthropic_messagessrc/ingress/anthropic_messagessrc/translation/anthropic_messagesConversion targets
pass-through self
openai_responsesResponse shape
Section titled “Response shape”A non-streaming Anthropic Messages response is a single top-level Message envelope:
{ "id": "msg_...", "type": "message", "role": "assistant", "model": "...", "content": [ { "type": "text", "text": "..." } ], "stop_reason": "end_turn", "usage": {}}Multiple output pieces live in content: Vec<ContentBlock>, not in multiple top-level messages.
Stop reason
Section titled “Stop reason”stop_reason explains why generation stopped:
end_turn— natural end of the assistant turntool_use— model requested tool executionmax_tokens— output was truncated by token limitstop_sequence— configured stop sequence matchedpause_turn— turn pausedrefusal— model refused
Wire structs use Option<T> for nullable/missing upstream fields, including compatibility providers and streaming start events.
Streaming
Section titled “Streaming”Streaming is event-based: message_start, content block events, message_delta, and message_stop. The final stop reason is usually carried by message_delta.delta.stop_reason.
For cross-protocol streaming details, see Protocol Conversion.