Skip to content

gpt-image-2 Image Generation Model

  • 2026.04.20 This site now supports the GPT image generation model gpt-image-2 via the dall-e interface
  • 2025.12.17 This site now supports the GPT image generation model gpt-image-1.5 via the dall-e interface
  • 2025.04.24 This site now supports the GPT image generation model gpt-image-1 via the dall-e interface
  • Supports multi-image reference via /v1/images/edits
  • Images are billed based on input and output image tokens

Billing Rules

  • Billing is determined by input.text_token, input.image_token, and output.image_token
  • (input.text_token*5 + input.image_token*10 + output.image_token*40)*7.1*10000/1000000 = credits
  • A 1024*1024 image at low quality costs approximately 800 credits; medium quality costs approximately 3000 credits, so please choose your quality level carefully
  • Billing reference: https://openai.com/api/pricing/ Image Generation API

Request Parameters

ParameterTypeRequiredDescription
modelstringYesModel name: gpt-image-2, gpt-image-1, gpt-image-1.5
promptstringYesImage description
nintegerNoNumber of images to generate
sizestringNoOutput size, supports resolution format or auto (default)
qualitystringNoQuality level: low, medium, high, auto (default)
imagefileNoSource image for editing, only for /v1/images/edits
response_formatstringNoResponse format: b64_json or url (default)
  • size constraints

    • Maximum side length ≤ 3840px
    • Both sides must be multiples of 16
    • Aspect ratio must not exceed 3:1
    • Total pixel count range: 655,360 ~ 8,294,400
  • Common size combinations

RatiosizeK
1:1 Square1024×10241K
1:1 Square2048×20482K
1:1 Square2880×28804K
16:9 Widescreen1280×7201K
16:9 Widescreen2048×11522K
16:9 Widescreen3840×21604K
9:16 Story720×12801K
9:16 Story1152×20482K
9:16 Story2160×38404K
5:4 Print1040×8321K
5:4 Print2080×16642K
5:4 Print3200×25604K
4:5 Feed832×10401K
4:5 Feed1664×20802K
4:5 Feed2560×32004K
4:3 Classic1024×7681K
4:3 Classic2048×15362K
4:3 Classic3264×24484K
3:4 Vertical768×10241K
3:4 Vertical1536×20482K
3:4 Vertical2448×32644K
3:2 Photo1008×6721K
3:2 Photo2064×13762K
3:2 Photo3504×23364K
2:3 Portrait672×10081K
2:3 Portrait1376×20642K
2:3 Portrait2336×35044K
21:9 Exclusive1344×5761K
21:9 Exclusive2016×8642K
21:9 Exclusive3808×16324K
Auto (matches reference image size)auto-

curl Examples

  • Supported endpoints: /v1/images/generations /v1/images/edits

Text to Image

shell
curl  https://api.openai-hk.com/v1/images/generations \
  -H 'Authorization: Bearer hk-replace-with-your-key' \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a white siamese cat",
    "n": 1,
    "size": "1024x1024",
    "quality": "low"
  }'
curl  https://api.openai-hk.com/v1/images/generations \
  -H 'Authorization: Bearer hk-replace-with-your-key' \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "a white siamese cat",
    "n": 1,
    "size": "1024x1024",
    "quality": "low"
  }'

gpt-image-1

Image Editing

shell
curl -X POST "https://api.openai-hk.com/v1/images/edits" \
  -H "Authorization: Bearer hk-replace-with-your-key" \
  -F "model=gpt-image-2" \
  -F "image[]=@body-lotion.png" \
  -F "image[]=@bath-bomb.png" \
  -F "image[]=@incense-kit.png" \
  -F "image[]=@soap.png" \
  -F 'prompt=Generate a photorealistic image of a gift basket on a white background labeled "Relax & Unwind" with a ribbon and handwriting-like font, containing all the items in the reference pictures'
curl -X POST "https://api.openai-hk.com/v1/images/edits" \
  -H "Authorization: Bearer hk-replace-with-your-key" \
  -F "model=gpt-image-2" \
  -F "image[]=@body-lotion.png" \
  -F "image[]=@bath-bomb.png" \
  -F "image[]=@incense-kit.png" \
  -F "image[]=@soap.png" \
  -F 'prompt=Generate a photorealistic image of a gift basket on a white background labeled "Relax & Unwind" with a ribbon and handwriting-like font, containing all the items in the reference pictures'

gpt-image-1

Response Data

json
{
  "created": 1776220106,
  "data": [
    {
      "revised_prompt": "your original prompt",
      "url": "https://myfile.addmao.com/20260427/d3272fe0-92c9-4f20-a50b-3114affc45c5.png",
      "b64_json": "data:image/png;base64 returned when response_format is b64_json"
    }
  ],
  "usage": {
    "input_tokens": 6,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 6
    },
    "output_tokens": 275,
    "total_tokens": 281
  }
}
{
  "created": 1776220106,
  "data": [
    {
      "revised_prompt": "your original prompt",
      "url": "https://myfile.addmao.com/20260427/d3272fe0-92c9-4f20-a50b-3114affc45c5.png",
      "b64_json": "data:image/png;base64 returned when response_format is b64_json"
    }
  ],
  "usage": {
    "input_tokens": 6,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 6
    },
    "output_tokens": 275,
    "total_tokens": 281
  }
}

Online Testing

Note

  1. Visit https://gpt4o.ddaiai.com/ (if blocked, try changing the subdomain prefix to suibian)
    2. If it is blocked, you can change the address yourself: https://suibian.ddaiai.com — replace suibian with something else, e.g. https://2025.ddaiai.com

Setup

  • Configure in the corresponding fields shown below
  • OpenAI API Base URL: https://api.openai-hk.com
  • OpenAI API KEY: hk-your-apiKey

cover

Result

Enter your prompt in the input box

Abstractify, optimize the style

Upload a reference image using the image+ button

gpt-image-1