v1

latestOpenAPI 3.1.02026-07-2219165126.1 KB
Messages

Create a message

Generate an Anthropic-compatible message response from Messages API input. Supports streaming, tool use, and multimodal content blocks.

post/v1/messages

Request body

modelstring required

Model identifier to route the request to.

max_tokensinteger required

Maximum number of output tokens to generate.

streamboolean

Return Anthropic-style SSE events instead of a single JSON response.

temperaturenumber nullable
top_pnumber nullable
stop_sequencesstring[] nullable

Example request

{
  "max_tokens": 512,
  "messages": [
    {
      "content": "Draft a release note for an API latency improvement.",
      "role": "user"
    }
  ],
  "model": "claude-sonnet-4.5"
}

Response

JSON response when stream=false, or Anthropic-style Server-Sent Events when stream=true.

idstring required
type'message'
role'assistant'
modelstring required
stop_reasonstring nullable
stop_sequencestring nullable
createdinteger required

Example response

{
  "content": [
    {
      "text": "The CAP theorem states that a distributed system can guarantee at most two of consistency, availability, and partition tolerance at the same time once network partitions are possible.",
      "type": "text"
    }
  ],
  "created": 1743393600,
  "id": "msg_123",
  "model": "claude-sonnet-4.5",
  "role": "assistant",
  "stop_reason": "end_turn",
  "type": "message",
  "usage": {
    "input_tokens": 17,
    "output_tokens": 32
  }
}