The image generation response
Represents the response from the image generation API.
background string
The background parameter used for the image generation. Either transparent or opaque.
created integer
The Unix timestamp (in seconds) of when the image was created.
data array
The list of generated images.
b64_json string
The base64-encoded JSON of the generated image. The default response_format is b64_json.
Returned for the GPT image models and dall-e-2 and dall-e-3 when response_format is b64_json.
url string
The URL of the generated image if response_format is url (default for dall-e-2 and dall-e-3). URLs are only valid for 60 minutes after the image has been generated.
revised_prompt string
The prompt that was used to generate the image. Returned for dall-e-3.
output_format string
The output format of the image generation. Either png, webp, or jpeg.
quality string
The quality of the image generated. Either low, medium, or high.
size string
The size of the image generated. Either 1024x1024, 1024x1536, or 1536x1024.
usage object
For gpt-image-1 only, the token usage information for the image generation.
total_tokens integer
Total number of tokens used in the request.
input_tokens integer
Number of input tokens used in the request.
output_tokens integer
The number of image tokens in the output image.
input_tokens_details object
Breakdown of input token usage.
text_tokens integer
Number of text tokens in the input.
image_tokens integer
Number of image tokens in the input.
{
"created": 1713833628,
"data": [
{
"b64_json": "..."
}
],
"background": "transparent",
"output_format": "png",
"size": "1024x1024",
"quality": "high",
"usage": {
"total_tokens": 100,
"input_tokens": 50,
"output_tokens": 50,
"input_tokens_details": {
"text_tokens": 10,
"image_tokens": 40
}
}
}