GPT Image 2 Text to Image
Images
GPT Image 2 Text to Image
POST
GPT Image 2 Text to Image
API call for the GPT Image 2 text-to-image generation model. Supports multiple quality levels (low/medium/high) and sizes. Generates images from text prompts, with configurable output format, compression ratio, and background settings.
Request Headers
Enum value:
application/jsonBearer authentication format: Bearer {{API Key}}.
Request Body
The number of images to generate. Defaults to 1. The actual number returned may be less than the requested number.Value range: [1, 10]
The size of the generated image. 1024x1024 is square, 1024x1536 is portrait, 1536x1024 is landscape, 2048x2048 is 2K square, 2048x1152 is 2K landscape, 3840x2160 is 4K landscape, 2160x3840 is 4K portrait, 2048x1360 is 3:2 landscape, 1360x2048 is 2:3 portrait, 1152x2048 is 9:16 portrait, 2048x1536 is 4:3 landscape, 1536x2048 is 3:4 portrait, 2048x880 is 21:9 ultra-wide, 880x2048 is 9:21 ultra-tall, 688x2048 is 1:3 portrait, 2048x688 is 3:1 landscape, 2048x1024 is 2:1 landscape, and 1024x2048 is 1:2 portrait.Available values:
1024x1024, 1024x1536, 1536x1024, 2048x2048, 2048x1152, 3840x2160, 2160x3840, 2048x1360, 1360x2048, 1152x2048, 2048x1536, 1536x2048, 2048x880, 880x2048, 688x2048, 2048x688, 2048x1024, 1024x2048, autoThe text prompt used to generate the image. Supports Chinese and English. Maximum length: 32,000 characters.Length limit: 0 - 32000
The quality level of the generated image. low is the fastest and lowest cost; medium balances quality and speed; high provides the best quality but is the slowest and most expensive.Available values:
low, medium, highBackground setting.Available values:
opaque, autoContent moderation level.Available values:
low, autoThe file format of the output image.Available values:
png, jpegCompression level of the output image (0-100). Only valid for jpeg format; png format is not supported (must be 100 or omitted).Value range: [0, 100]
Response Information
Array of generated image URLs.