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.

Authentication

AuthorizationBearer
Your production key sent as a bearer token.

Request

This endpoint expects an object.
modelstringRequired
max_tokensintegerRequired
messageslist of objectsRequired
systemstring or list of objects or nullOptional
streambooleanOptionalDefaults to false
temperaturedouble or nullOptional
top_pdouble or nullOptional
top_kinteger or nullOptional
stop_sequenceslist of strings or nullOptional
toolslist of objects or nullOptional
tool_choicemap from strings to any or nullOptional
metadatamap from strings to any or nullOptional
service_tierstring or nullOptional

Response

Successful Response
idstring
type"message"
role"assistant"
modelstring
contentlist of objects
usageobject
stop_reasonenum or nullOptional
stop_sequencestring or nullOptional

Errors

422
Unprocessable Entity Error