Create image
/v1/images/generationsCreate an image from text, or create/edit an image from text plus one or more input images.
Image generation responses are returned directly from this request; unlike video generation, there is no submit-and-poll task flow.
Use the returned data[].url to download the image directly. To use the dedicated image download or delete endpoints, first retrieve the image record ID from GET /v1/images.
Authentication
Authorization Bearer
API key as bearer token in Authorization header.
Request Body
modelstringrequiredModel ID.
promptstringrequiredImage generation prompt.
nintegerNumber of images to generate.
sizestringRequested output image dimensions, such as width-by-height, when the model uses explicit image size values.
aspect_ratiostringRequested output image shape as a width-to-height ratio.
resolutionstringRequested output image resolution or resolution tier.
qualitystringRequested generation quality or fidelity tier.
seedintegerOptional numeric seed for repeatable generation when deterministic seeding is supported.
prompt_extendbooleanPrompt extension flag.
negative_promptstringNegative prompt.
max_reference_imagesintegerReference image limit.
watermarkbooleanControls whether generated images include a watermark when supported.
response_formatstringResponse format.
imagesarrayReference images.
sequential_image_generationstringSequential image generation mode.
sequential_image_generation_optionsobjectSequential image generation configuration.
sequential_image_generation_options.max_imagesintegerMaximum number of images to generate in sequential mode.
optimize_prompt_optionsobjectPrompt optimization configuration.
optimize_prompt_options.modestringPrompt optimization mode, such as standard or fast.
strengthnumberInput image influence strength.
enable_interleavebooleanInterleaved generation flag.
enable_web_searchbooleanWeb search flag.
output_formatstringRequested file format for generated image outputs.
streambooleanStreaming response flag.
metadataobjectApplication metadata.
extra_bodyobjectAdditional request body fields.
provider_optionsobjectUpstream configuration.
Response
createdintegerUnix timestamp.
modelstringModel identifier that served the request.
dataobject[]Generated images.
data.urlstringURL to download the generated image.
data.b64_jsonstringBase64-encoded image when returned by the model.
data.output_formatstringOutput image format when returned by the model, for example jpeg or png.
data.sizestringOutput image dimensions when returned by the model, in <width>x<height> format.
data.errorobject | nullPer-image error details for failed image generations.
usageobjectUsage stats for the request.
usage.generated_imagesintegerNumber of images successfully generated by the model.
usage.input_imagesintegerNumber of input reference images when returned by the model.
usage.output_tokensintegerOutput token usage for generated images when returned by the model.
usage.total_tokensintegerTotal token usage for this request when returned by the model.
errorobjectRequest-level error details when an error payload is returned.
error.codestringError code.
error.messagestringError message.