Use GPT image generation models to quickly generate high-quality images from text descriptions. Supports multiple size and quality options to meet various image generation needs.
Bearer authentication format: Bearer {{API Key}}.
Request Body
The model used for image generation. Currently supports gpt-image-1, gpt-image-1.5.
Text description of the desired image. For gpt-image-1, gpt-image-1.5, the maximum length is 32000 characters.
Quality of the generated image, Default: auto. For gpt-image-1, gpt-image-1.5, supported values are: auto, high, medium, low.
Number of images to generate, Range: 1~10, Default: 1.
Size of the generated image, Default: auto. For gpt-image-1, gpt-image-1.5, supported values are:
1024x1024: Square
1536x1024: Landscape
1024x1536: Portrait
auto: Default
Response Parameters
Unix timestamp (in seconds) of when the image was generated.
List of generated images. Base64-encoded string of the generated image.
Output format of the generated image. Possible values: png, webp, jpeg.
Quality of the generated image. Possible values: low, medium, high.
Size of the generated image. Possible values: 1024x1024, 1024x1536, 1536x1024.
Only supported by gpt-image-1, gpt-image-1.5. Token usage information for image generation. Number of tokens for the input prompt (including images and text).
Detailed information about input tokens. Number of image tokens in the input prompt.
Number of text tokens in the input prompt.
Number of output tokens generated by the model.
Total number of tokens consumed for this image generation (including images and text).