Create a message
Anthropic-compatible Messages endpoint. Accepts the Anthropic Messages request shape and routes to any catalogued model.
Also served at /v1/anthropic/v1/messages; both paths accept the same requests. This bare path is what the Anthropic SDK builds from a bare-host base URL, so pointing the SDK at https://api-gateway.merge.dev works with no other changes.
Supports Anthropic message threads through the thread field, so a long conversation can continue without resending earlier turns. See Multi-turn conversations.
Authentication
Request
Top-level prompt-caching setting.
Anthropic output settings; only effort is applied.
Customer ID (UUID) to scope this request to, applying that customer’s routing policy, provider keys, budget, and usage attribution.
Routing policy ID for this request: an org-level policy, or a project or customer policy when the request carries that scope.
Ordered list of models to try, first success wins, with the same rules as priority_order on POST /v1/responses.
Restrict routing to one vendor (hosting platform).
Ordered list of acceptable vendors; the first available one wins.
Provider-specific options, keyed by provider family.
Return prompt-injection and DLP results in a top-level guardrails object.
Retry once at the standard tier, billed at standard rates, if the requested tier is throttled (429 or 503).
Anthropic message threads (beta). {"type": "create"} sends the full conversation and asks Anthropic to hold it. {"type": "continue", "previous_message_id": "msg_..."} sends only the new turn and continues from a previous response’s id. A continue can’t carry system or tools. Threads need a model Gateway serves through Anthropic directly. If the thread can’t be continued, Gateway returns 404 with error.details.error_code: "thread_not_found": resend the full conversation with type: "create". See Multi-turn conversations.