Generate an image
Generates an image from a text prompt. Returns OpenAI-compatible sync JSON by default (works with client.images.generate()); pass stream: true to get an SSE event stream instead. Image-to-image is supported via inputImages / input_references.
/api/v1/images/generationsAuthorizations
AuthorizationrequiredAPI key as bearer token in the Authorization header.
Body
modelrequiredThe image generation model to use, provider-qualified, e.g. "openai/gpt-image-2".
"openai/gpt-image-2"promptrequiredText description of the desired image.
"a red cat on a sofa"nNumber of images to generate, 1–10.
1sizeImage size — explicit pixels ("2048x2048") or a tier ("2K", "4K"). Forwarded to the provider as-is; supported sizes vary by model.
"1024x1024"streamSelects the response shape: omitted or false = OpenAI-compatible sync JSON (the default), true = SSE event stream.
input_referencesSource images for image-to-image (data: or https: URLs), up to 8. Alias of inputImages (industry-conventional field name); both pass content moderation first. Returns 400 — not a warning — when the model's route does not support i2i.
aspect_ratioAspect ratio of the generated image. Natively supported on some model routes — check supported_parameters in the GET /api/v1/images/models response for each model; unsupported routes ignore the field and note it in the response's warnings[] (the request still succeeds).
1:11:21:41:82:12:33:23:44:14:34:55:48:19:1616:99:19.519.5:99:2020:99:2121:9auto"16:9"resolutionResolution tier; concrete pixels are derived per provider. Natively supported on some model routes — check supported_parameters in the GET /api/v1/images/models response for each model; unsupported routes ignore the field and note it in the response's warnings[] (the request still succeeds).
5121K2K4K"2K"qualityRendering quality. Natively supported on some model routes — check supported_parameters in the GET /api/v1/images/models response for each model; unsupported routes ignore the field and note it in the response's warnings[] (the request still succeeds).
autolowmediumhighbackgroundBackground treatment; transparent requires an alpha-capable output_format (png/webp). Natively supported on some model routes — check supported_parameters in the GET /api/v1/images/models response for each model; unsupported routes ignore the field and note it in the response's warnings[] (the request still succeeds).
autotransparentopaqueoutput_formatEncoding of the returned image bytes. Natively supported on some model routes — check supported_parameters in the GET /api/v1/images/models response for each model; unsupported routes ignore the field and note it in the response's warnings[] (the request still succeeds).
pngjpegwebpsvg"png"output_compressionCompression level (0–100) for webp/jpeg output; ignored for png. Natively supported on some model routes — check supported_parameters in the GET /api/v1/images/models response for each model; unsupported routes ignore the field and note it in the response's warnings[] (the request still succeeds).
100seedDeterministic sampling seed; identical seed + parameters should reproduce the result, though not all providers guarantee it. Natively supported on some model routes — check supported_parameters in the GET /api/v1/images/models response for each model; unsupported routes ignore the field and note it in the response's warnings[] (the request still succeeds).