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
Authorization
## All APIs require Bearer Token authentication ## **Get API Key:** Visit [API Key Management Page](https://starmagic.ai/app/api-keys) to get your API Key **Add to request header:** ``` Authorization: Bearer YOUR_API_KEY ```
Authorization: Bearer YOUR_API_KEYRequest body
application/jsonImage generation model name
"gpt-image-1.5"Prompt describing the image you want to generate, or describing how to edit the input image. Limited to 2000 tokens
"A beautiful colorful sunset over the ocean"Size of the generated image, supports two formats: **Aspect Ratio Format:** - `1:1`: Square - `2:3`: Portrait - `3:2`: Landscape **Pixel Format:** - `1024x1024`: Square - `1024x1536`: Portrait - `1536x1024`: Landscape
"1024x1024"Quality of the generated image **Supported quality levels:** - `low`: Low quality, faster generation - `medium`: Medium quality - `high`: High quality, slower generation (default)
"high"Reference image URL list for image-to-image and image editing features **Notes:** - Supports `1~16` images 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`
1HTTPS 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 `2048` characters **Callback Mechanism:** - Timeout: `10` seconds - Maximum `3` retries after failure (at `1`/`2`/`4` seconds 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
application/jsonResponse body
Task creation timestamp
1757156493Task ID
"task-unified-1757156493-imcg5zqt"Actual model name used
"gpt-image-1.5"Task object type
"image.generation.task"Task progress percentage (0-100)
0Task status
"pending"{
"can_cancel": true,
"estimated_time": 100
}Task output type
"image"Usage and billing information
{
"billing_rule": "per_call",
"credits_reserved": 2.5,
"user_group": "default"
}
