Anthropic Messages

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

身份验证

X-API-Keystring

Use X-API-Key: $JOY_TOKEN_API_KEY.

请求头

X-Request-IDstring可选
Optional request identifier for log, billing, and debugging correlation.

请求

This endpoint expects an object.
modelenum必需

Must be auto. Concrete model IDs are not accepted.

max_tokensinteger必需>=1
Maximum number of output tokens.
messageslist of objects必需
systemstring or list of maps from strings to any可选
streamboolean可选默认为 false

Return an Anthropic-compatible SSE stream when true.

temperaturedouble可选0-2
Sampling temperature forwarded to the selected provider when supported.
toolslist of maps from strings to any可选

响应头

X-DAOE-Failoverstring可选
Present on streaming responses when provider failover occurred.

响应

Successful Anthropic-compatible message response.

idstring
typeenum
roleenum
modelstring
contentlist of maps from strings to any
stop_reasonstring or null可选
stop_sequencestring or null可选
usageobject可选
metadataobject可选

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.

错误

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