POST/v1/messages

/v1/messages

Anthropic Messages requests are accepted and normalized by the Gateway.

Request#

The anthropic-version header is accepted and forwarded unchanged.

curl https://api.atptoken.ai/v1/messages \
  -H "Authorization: Bearer atp-..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "<model from GET /v1/models>",
    "max_tokens": 256,
    "messages": [{"role": "user", "content": "hi"}]
  }'

Parameters#

The top-level system field accepts a string or an array of text blocks (cache_control on a block is accepted).

FieldTypeDescription
modelstring · requiredA model id from GET /v1/models.
max_tokensinteger · requiredMax output tokens (Anthropic requires this). With extended thinking, the thinking budget counts against it — too low returns a 200 with empty content (see Errors).
messagesarray · requiredConversation turns, each { role, content }.
systemstring or arraySystem prompt, as a string or an array of text blocks.
temperaturenumberSampling temperature, 0–1.
streambooleanStream as Anthropic SSE events.
Was this page helpful?