Anthropic Messages

Creates a model response using an Anthropic-compatible Messages request.

Authentication

X-API-Keystring

Use X-API-Key: $JOY_TOKEN_API_KEY.

Headers

X-Request-IDstringOptional
Optional request identifier for log, billing, and debugging correlation.

Request

This endpoint expects an object.
modelenumRequired

Must be auto. Concrete model IDs are not accepted.

max_tokensintegerRequired>=1
Maximum number of output tokens.
messageslist of objectsRequired
systemstring or list of maps from strings to anyOptional
streambooleanOptionalDefaults to false

Return an Anthropic-compatible SSE stream when true.

temperaturedoubleOptional0-2
Sampling temperature forwarded to the selected provider when supported.
toolslist of maps from strings to anyOptional

Response headers

X-DAOE-FailoverstringOptional
Present on streaming responses when provider failover occurred.

Response

Successful Anthropic-compatible message response.

idstring
typeenum
roleenum
modelstring
contentlist of maps from strings to any
stop_reasonstring or nullOptional
stop_sequencestring or nullOptional
usageobjectOptional
metadataobjectOptional

JoyToken routing and billing metadata appended by the gateway when available. In orchestration (multi-task planning) mode this object also carries per-task identifiers, and the response returns one metadata object per task.

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
429
Too Many Requests Error
500
Internal Server Error