Image Generations
Generates images from a text prompt using an OpenAI-compatible request. Model and prompt are required. JoyToken forwards supported image options to the selected provider and appends routing and billing details under metadata. This endpoint is non-streaming: do not send stream: true. JoyToken returns one application/json response after generation completes and never emits SSE events or [DONE].
身份验证
Use Authorization: Bearer $JOY_TOKEN_API_KEY.
请求头
请求
Must be auto. Concrete image model IDs are not accepted.
Provider-supported image quality, such as standard, hd, medium, or high.
Output mode. Defaults to b64_json (base64 in data[].b64_json). Set url to receive a hosted image URL in data[].url instead; this only works when every eligible image model supports URL output, otherwise JoyToken falls back to b64_json. Omit unless you specifically need URL output.
Provider-supported output dimensions, for example 1024x1024.
Provider-supported image style.
Optional end-user identifier.
Provider-supported background mode.
Provider-supported moderation setting.
Provider-supported image format, such as png, jpeg, or webp.
响应
Successful non-streaming image generation result returned as one application/json document.
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.
