Skip to content

gpt-image-2 绘图模型

  • 2026.04.20 本站已经支持 gpt 的画图模型 gpt-image-2 调用方式 dall-e 接口
  • 2025.12.17 本站已经支持 gpt 的画图模型 gpt-image-1.5 调用方式 dall-e 接口
  • 2025.04.24 本站已经支持 gpt 的画图模型 gpt-image-1 调用方式 dall-e 接口
  • 支持多图参考 /v1/images/edits
  • 图片会计费输入、输出图片的 token

计费规则

  • 计费由 input.text_token input.image_token ouput.image_token 决定
  • (input.text_token*5 + input.image_token*10 + output.image_token*40)*7.1*10000/1000000 = 积分
  • 如果是 1024*1024 的low品质消耗积分大概在 800 积分, 如果medium品质大概在 3000 积分 ,所以请选择好你的品质
  • 计费参考 https://openai.com/api/pricing/ Image Generation API

请求参数

参数名类型是否必须描述
modelstring模型名称 gpt-image-2、gpt-image-1、gpt-image-1.5
promptstring图片描述
ninteger生成图片数量
sizestring输出尺寸,支持分辨率格式或 auto(默认)
qualitystring画质档位:low、medium、high、auto(默认)
imagefile图片编辑原图 仅支持 /v1/images/edits
response_formatstring响应格式:b64_json 或 url(默认)
  • size 约束

    • 最大边长 ≤ 3840px
    • 两边均须为 16 的倍数
    • 长短边比例不超过 3:1
    • 总像素数范围:655,360 ~ 8,294,400
  • 常用尺寸组合

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-

curl 实例

  • 请求入口支持 /v1/images/generations /v1/images/edits

文生图

shell
curl  https://api.openai-hk.com/v1/images/generations \
  -H 'Authorization: Bearer hk-替换为你的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-替换为你的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

图片编辑

shell
curl -X POST "https://api.openai-hk.com/v1/images/edits" \
  -H "Authorization: Bearer hk-替换为你的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-替换为你的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

返回数据

json
{
  "created": 1776220106,
  "data": [
    {
      "revised_prompt": "你原来输入prompt",
      "url": "https://myfile.addmao.com/20260427/d3272fe0-92c9-4f20-a50b-3114affc45c5.png",
      "b64_json": "data:image/png;base64 当response_format 参数为 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": "你原来输入prompt",
      "url": "https://myfile.addmao.com/20260427/d3272fe0-92c9-4f20-a50b-3114affc45c5.png",
      "b64_json": "data:image/png;base64 当response_format 参数为 b64_json 时返回"
    }
  ],
  "usage": {
    "input_tokens": 6,
    "input_tokens_details": {
      "image_tokens": 0,
      "text_tokens": 6
    },
    "output_tokens": 275,
    "total_tokens": 281
  }
}

在线测试

注意

1.访问 https://gpt4o.ddaiai.com/ (如果被墙了,换下二级域名前缀 suibian)
2.如果发现被墙了 可以自己换地址 https://suibian.ddaiai.comsuibian 换其他的 如 https://2025.ddaiai.com 都能访问

设置

cover

效果

输入框 提问对话

抽象化,优化风格

同时在图片+的地方 上传参考图

gpt-image-1