StarMagicStarMagic
English
简体中文简繁體中文繁EnglishEN日本語日EspañolES한국어KO
Integration Guide
GPT Image 1.5 Image Generation
StarMagicStarMagic
English
简体中文简繁體中文繁EnglishEN日本語日EspañolES한국어KO
ImageGPT ImageGPT-Image.1.5

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

AuthorizationstringheaderRequired

## 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_KEY

Request body

application/json
modelenum<gpt-image-1.5>Required

Image generation model name

"gpt-image-1.5"
promptstringRequired

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"
sizeenum<1:1 | 2:3 | 3:2 | 1024x1024 | 1024x1536 | 1536x1024>

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"
qualityenum<low | medium | high>

Quality of the generated image **Supported quality levels:** - `low`: Low quality, faster generation - `medium`: Medium quality - `high`: High quality, slower generation (default)

"high"
image_urlsstring<uri>[]

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"
]
nenum<1>

Number of images to generate, currently only supports `1`

1
callback_urlstring<uri>

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 `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/json
成功

Response body

createdinteger

Task creation timestamp

1757156493
idstring

Task ID

"task-unified-1757156493-imcg5zqt"
modelstring

Actual model name used

"gpt-image-1.5"
objectenum<image.generation.task>

Task object type

"image.generation.task"
progressinteger

Task progress percentage (0-100)

0
statusenum<pending | processing | completed | failed>

Task status

"pending"
task_infoobject
{
  "can_cancel": true,
  "estimated_time": 100
}
typeenum<text | image | audio | video>

Task output type

"image"
usageobject

Usage and billing information

{
  "billing_rule": "per_call",
  "credits_reserved": 2.5,
  "user_group": "default"
}
POST/v1/images/generations
curl --request POST \
  --url https://api.starmagic.ai/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "gpt-image-1.5",
  "prompt": "A beautiful colorful sunset over the ocean"
}'
Response: 成功
{
  "created": 1757156493,
  "id": "task-unified-1757156493-imcg5zqt",
  "model": "gpt-image-1.5",
  "object": "image.generation.task",
  "progress": 0,
  "status": "pending",
  "task_info": {
    "can_cancel": true,
    "estimated_time": 100
  },
  "type": "image",
  "usage": {
    "billing_rule": "per_call",
    "credits_reserved": 2.5,
    "user_group": "default"
  }
}

MiniMax-M3 - Anthropic-Compatible API

Previous Page

GPT Image 2 Image Generation Beta

Next Page