Anthropic Messages — drop-in proxy for Claude Code
Anthropic-shape Messages endpoint. Translates the request into OpenAI Chat Completions internally and dispatches to the resolved EndpointConfig (token binding → global "Anthropic Proxy Backend" → model: "toolpiper:tp-<id>" prefix override).
Authenticated via Authorization: Bearer tp_<64 hex> (Claude Code's ANTHROPIC_AUTH_TOKEN path), validated by the unified middleware against the same token store as every other authenticated route. Errors return Anthropic-shape envelopes ({type: "error", error: {type, message}}), never the OpenAI shape — middleware-emitted 401/403/421 responses are remapped to Anthropic-shape via authErrorResponse(forPath:...).
Streaming (stream: true) emits the canonical Anthropic SSE sequence: message_start → (content_block_start → content_block_delta+ → content_block_stop)+ → message_delta → message_stop, with ping keepalives every 15 s.
See docs/features/anthropic-api-proxy.md for the full Protocol Coverage Matrix.
Request
- Base URL: http://localhost:9998
- URL: http://localhost:9998/v1/messages
- Auth: HTTP bearer
Request body
Response
Buffered (stream: false): a single Anthropic Message JSON object. Streaming (stream: true): text/event-stream with the Anthropic SSE sequence.
Changes
No recorded changes to this operation across all 1 revision of this API.