API Guide
JoyToken exposes OpenAI-compatible and Anthropic-compatible model endpoints for developers.
Common API
Use JOY_TOKEN_API_BASE_URL from Environments.
Model descriptions are localized with the optional locale query parameter. Use locale=en for English or locale=zh for Chinese. When omitted, JoyToken defaults to English.
Choose a Protocol
OpenAI
Anthropic
Responses is available at POST /openai/v1/responses. Send input as a string or message input items; non-streaming text is returned in output[0].content[0].text.
Image generation is available at POST /openai/v1/images/generations. model must be auto and prompt is required. Image options such as n, size, quality, style, and response_format are forwarded to the selected provider; omit provider-specific options unless every eligible image model supports them.
Image generation is non-streaming. Do not send stream: true or consume this endpoint as SSE: keep the request open until JoyToken returns one complete application/json response. Generated images are returned in data; use data[0].url or data[0].b64_json according to response_format.
Do not send both Authorization and X-API-Key on the same request. If both are present, the current gateway reads X-API-Key first.
