Skip to navigation

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.
modelstringRequired

Use auto to let the gateway pick the model, or pass a concrete modelName from the model catalog to pin that model. Both ways are available to every account. When a model is pinned, tier is ignored, orchestration is not used, and there is no fallback to another model.

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
Allowed values:
roleenum
Allowed values:
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