Create Message

POST/v1/messages
Create a model response using the Anthropic-compatible Messages format.

Request Body

application/json
model:requiredstring

Model identifier used for this request.

messages:requiredarray

Messages that make up the conversation.

max_tokens:requiredinteger

Maximum number of tokens allowed in the generated message.

Example1024
stream:optionalboolean

Whether to stream partial results as they become available.

thinking:optionalobject

Extended thinking configuration for supported models.

Response

200

A successful request returns a JSON response. The complete example is shown in the code panel.