application/json。aspect_ratio + resolution 这种比例加档位的写法。response_format=url),链接有时效,请拿到后尽快下载保存;需要直接拿图片数据时传 response_format=b64_json。Authorization: Bearer ********************{
"model": "gpt-image-2",
"prompt": "一张现代 API 平台首页插图,白底,青蓝色块,干净留白",
"size": "1536x1024",
"quality": "high",
"response_format": "url"
}curl --location '/v2/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "gpt-image-2",
"prompt": "一张现代 API 平台首页插图,白底,青蓝色块,干净留白",
"size": "1536x1024",
"quality": "high",
"response_format": "url"
}'{
"created": 1790557800,
"data": [
{
"url": "https://example.com/images/img-1.png"
}
],
"size": "1536x1024",
"quality": "high",
"output_format": "png"
}