Images schemas

The full schema and model definitions referenced by the Images endpoints. Each endpoint page links here for the detailed shape of its request and response objects.

Schemas

Create Image Edit Request

FieldTypeRequiredDescription
imagestring (binary)NoImage to edit. PNG format.
promptstringYesText description of the edits to apply.
modelstringYesModel ID.
nintegerNoNumber of edited images to generate. Range: 1-10. Defaults to 1. (minimum: 1, maximum: 10, default: 1)
sizestringNoRequested image shape as width x height (e.g., '1024x1024'). The values set the aspect ratio; the image is produced at the generator's own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.
response_formatenum ('url', 'b64_json')NoFormat for the edited images. One of url or b64_json. Default: b64_json. (default: b64_json)
reasoning_strengthenum ('low', 'high')NoHow much reasoning the image generator applies before producing the edited image. One of low or high. low returns after a single generation pass (no self-refinement); high (the default) lets the generator iteratively refine. (default: high)
moderationstringNoModeration level for the safety pipeline. One of auto, low, or none. Supported only on models that accept this parameter; other models reject it with a 400. An unrecognized value is rejected with a 400. none additionally requires per-application access.
streambooleanNoIf true, streams the response as server-sent events. Defaults to false. (default: false)
partial_imagesintegerNoNumber of partial images to generate during streaming. Range: 0-3. Accepted but ignored. (minimum: 0, maximum: 3, default: 0)
tool_enablementImageToolEnablementNoPer-tool controls for the image generator's planner. Omit to keep the default (all tools available).

Create Image Request

FieldTypeRequiredDescription
modelstringYesModel ID for image generation.
promptstringYesText description of the images to generate.
nintegerNoNumber of images to generate. Range: 1-10. Defaults to 1. (minimum: 1, maximum: 10, default: 1)
sizestringNoRequested image shape as width x height (e.g., '1024x1024'). The value is converted into an aspect ratio only; the image is produced at the generator's own fixed output resolution, so the returned pixel dimensions stay constant regardless of the numbers supplied — only the aspect ratio changes.
response_formatenum ('url', 'b64_json')NoFormat for returned images. One of: url, b64_json. Defaults to b64_json. (default: b64_json)
moderationstringNoModeration level for the safety pipeline. One of auto, low, or none. Supported only on models that accept this parameter; other models reject it with a 400. An unrecognized value is rejected with a 400. none additionally requires per-application access.
output_formatstringNoRequested file type for the generated images. One of png, jpeg, or webp. Defaults to webp when omitted; any other value is rejected.
reasoning_strengthenum ('low', 'high')NoHow much reasoning the image generator applies before producing the image. One of low or high. low returns after a single generation pass (no self-refinement); high (the default) lets the generator iteratively refine. (default: high)
userstringNoA stable end-user identifier that helps detect and mitigate abuse. Use it on the images endpoints; on the Responses and Chat Completions endpoints, use safety_identifier instead.
streambooleanNoIf true, streams the response as server-sent events. Defaults to false. (default: false)
tool_enablementImageToolEnablementNoPer-tool controls for the image generator's planner. Omit to keep the default (all tools available).

Edit Image Body Json Param

FieldTypeRequiredDescription
modelstringYesModel ID.
promptstringYesText description of the edits to apply.
imagesarray of ImageInputItemYesImages to edit. (minItems: 1)
nintegerNoNumber of edited images to generate. Range: 1-10. Defaults to 1. (minimum: 1, maximum: 10, default: 1)
sizestringNoRequested image shape as width x height (e.g., '1024x1024'). The value is converted into an aspect ratio only; the image is produced at the generator's own fixed output resolution, so the returned pixel dimensions stay constant regardless of the numbers supplied — only the aspect ratio changes.
response_formatenum ('url', 'b64_json')NoFormat for the edited images. One of url or b64_json. Default: b64_json. (default: b64_json)
output_formatstringNoRequested file type for the edited images. One of png, jpeg, or webp. Defaults to webp when omitted; any other value is rejected.
reasoning_strengthenum ('low', 'high')NoHow much reasoning the image generator applies before producing the edited image. One of low or high. low returns after a single generation pass (no self-refinement); high (the default) lets the generator iteratively refine. (default: high)
moderationstringNoModeration level for the safety pipeline. One of auto, low, or none. Supported only on models that accept this parameter; other models reject it with a 400. An unrecognized value is rejected with a 400. none additionally requires per-application access.
streambooleanNoIf true, streams the response as server-sent events. Defaults to false. (default: false)
userstringNoA stable end-user identifier that helps detect and mitigate abuse. Use it on the images endpoints; on the Responses and Chat Completions endpoints, use safety_identifier instead.
tool_enablementImageToolEnablementNoPer-tool controls for the image generator's planner. Omit to keep the default (all tools available).

Image Edit Completed Event

Image edit completed event.

FieldTypeRequiredDescription
typeenum ('image_edit.completed')YesEvent type; always image_edit.completed.
b64_jsonstringYesBase64-encoded edited image data.
created_atintegerYesUnix timestamp (seconds) for when the event was created.
output_indexinteger (int64)YesZero-based index of the edited image in the response.
sizestringNoRequested image shape as width x height. The values set the aspect ratio; the image is produced at the generator's own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.
qualitystringNoQuality setting for the edited images. Accepted but ignored.
backgroundstringNoBackground setting for the edited images. Accepted but ignored.
output_formatstringNoOutput format for the edited images.
usageImageGenUsageNoAggregate token usage for the image edit request. Present only on the final completed event.

Image Edit Partial Image Event

Image edit partial image event.

FieldTypeRequiredDescription
typeenum ('image_edit.partial_image')YesEvent type; always image_edit.partial_image.
b64_jsonstringYesBase64-encoded partial image data.
created_atintegerYesUnix timestamp (seconds) for when the event was created.
sizestringNoRequested image shape as width x height. The values set the aspect ratio; the image is produced at the generator's own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.
qualitystringNoQuality setting for the edited images. Accepted but ignored.
backgroundstringNoBackground setting for the edited images. Accepted but ignored.
output_formatstringNoOutput format for the edited images. Accepted but ignored.
partial_image_indexintegerYesZero-based index for the partial image.

Image Edit Stream Event

Type: ImageEditPartialImageEvent | ImageEditCompletedEvent

Image Gen Completed Event

Image generation completed event.

FieldTypeRequiredDescription
typeenum ('image_generation.completed')YesEvent type; always image_generation.completed.
b64_jsonstringYesBase64-encoded image data.
created_atintegerYesUnix timestamp (seconds) for when the event was created.
output_indexinteger (int64)YesZero-based index of the generated image in the response.
sizestringNoRequested image shape as width x height. The values set the aspect ratio; the image is produced at the generator's own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.
qualitystringNoQuality setting for the generated images. Accepted but ignored.
backgroundstringNoBackground setting for the generated images. Accepted but ignored.
output_formatstringNoOutput format for the generated images.
usageImageGenUsageNoAggregate token usage for the image generation request. Present only on the final completed event.

Image Gen Partial Image Event

Image generation partial image event.

FieldTypeRequiredDescription
typeenum ('image_generation.partial_image')YesEvent type; always image_generation.partial_image.
b64_jsonstringYesBase64-encoded partial image data.
created_atintegerYesUnix timestamp (seconds) for when the event was created.
sizestringNoRequested image shape as width x height. The values set the aspect ratio; the image is produced at the generator's own resolution, so the returned pixel dimensions will not necessarily match the numbers supplied.
qualitystringNoQuality setting for the generated images. Accepted but ignored.
backgroundstringNoBackground setting for the generated images. Accepted but ignored.
output_formatstringNoOutput format for the generated images. Accepted but ignored.
partial_image_indexintegerYesZero-based index of the partial image in the streaming sequence.

Image Gen Stream Event

Type: ImageGenPartialImageEvent | ImageGenCompletedEvent

Image Gen Usage

FieldTypeRequiredDescription
input_tokensintegerNoNumber of input tokens.
input_tokens_detailsobjectNoBreakdown of input tokens by modality.
input_tokens_details.image_tokensintegerNoNumber of image tokens in the input.
input_tokens_details.text_tokensintegerNoNumber of text tokens in the input.
output_tokensintegerNoNumber of output tokens.
total_tokensintegerNoTotal number of tokens.

Image Input Item

FieldTypeRequiredDescription
image_urlstringNoImage URL.
file_idstringNoFile ID.

Image Object

FieldTypeRequiredDescription
b64_jsonstringNoBase64-encoded image data.
urlstringNoImage URL.
revised_promptstringNoRevised prompt used for the image.

Image Tool Enablement

Per-tool controls for the image generator's agentic planner. Omit to keep the default (all tools available); set a field to false to disable that tool for the request.

FieldTypeRequiredDescription
enable_image_searchbooleanNoWhether the image generator may search the web for visual references. false disables it.
enable_web_searchbooleanNoWhether the image generator may search the web for facts. false disables it (also drops the browser tools).
enable_shellbooleanNoWhether the image generator may run code to build layouts and charts. false disables it.

Images Response

FieldTypeRequiredDescription
createdintegerYesUnix timestamp (seconds) for when the images were created.
dataarray of ImageObjectYesArray of generated images.
output_formatstringNoFile type of the generated images. Echoes the requested output_format (png, jpeg, or webp); webp when omitted.
backgroundstringNoBackground setting for the generated images. Accepted but ignored.
usageImageGenUsageNoToken usage for the image generation request.