Anthropic-compatible
POST/v1/messages

Anthropic Messages requests are accepted and normalized by the Gateway. The top-level system field must be a string. The array form used by Anthropic's cache_control feature is not yet supported — sending an array returns 400 invalid_request_error. The anthropic-version header is accepted and forwarded unchanged.

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](/docs/errors)).
messagesarray · requiredConversation turns, each { role, content }.
systemstringSystem prompt. Must be a string, not an array.
temperaturenumberSampling temperature, 0–1.
streambooleanStream as Anthropic SSE events.

Request

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"}]
  }'