GPT Image 1.5 Image Generation
- GPT Image 1.5 (gpt-image-1.5) model supports text-to-image, image-to-image, and image editing modes
- Asynchronous processing mode, use the returned task ID to query status
- Generated image links are valid for 24 hours, please save them promptly
Authorizations
All APIs require Bearer Token authentication
Get API Key:
Visit API Key Management Page to get your API Key
Add to request header:
Authorization: Bearer YOUR_API_KEYBody
Image generation model name
gpt-image-1.5 "gpt-image-1.5"
Prompt describing the image you want to generate, or describing how to edit the input image. Limited to 2000 tokens
2000"A beautiful colorful sunset over the ocean"
Size of the generated image, supports two formats:
Aspect Ratio Format:
1:1: Square2:3: Portrait3:2: Landscape
Pixel Format:
1024x1024: Square1024x1536: Portrait1536x1024: Landscape
1:1, 2:3, 3:2, 1024x1024, 1024x1536, 1536x1024 "1024x1024"
Quality of the generated image
Supported quality levels:
low: Low quality, faster generationmedium: Medium qualityhigh: High quality, slower generation (default)
low, medium, high "high"
Reference image URL list for image-to-image and image editing features
Notes:
- Supports
1~16images per request - Maximum size per image:
50MB - Supported formats:
.jpeg,.jpg,.png,.webp - Image URLs must be directly accessible by the server, or URLs that trigger direct download (typically URLs ending with image extensions like
.png,.jpg)
[
"https://example.com/image1.png",
"https://example.com/image2.png"
]Number of images to generate, currently only supports 1
1 1
HTTPS callback URL for task completion
Callback Timing:
- Triggered when task is completed, failed, or cancelled
- Sent after billing confirmation
Security Restrictions:
- HTTPS protocol only
- Internal IP addresses are prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
- URL length must not exceed
2048characters
Callback Mechanism:
- Timeout:
10seconds - Maximum
3retries after failure (at1/2/4seconds after failure) - Callback response format is consistent with task query API
- 2xx status code is considered successful, other codes trigger retry
"https://your-domain.com/webhooks/image-task-completed"
Response
Image task created successfully
Task creation timestamp
1757156493
Task ID
"task-unified-1757156493-imcg5zqt"
Actual model name used
"gpt-image-1.5"
Task object type
image.generation.task Task progress percentage (0-100)
0 <= x <= 1000
Task status
pending, processing, completed, failed "pending"
Async task information
Task output type
text, image, audio, video "image"
Usage and billing information