跳转到主要内容
厂商: OpenAI Model ID: gpt-image-2 能力: 1024² – 4096² · 写实 · prompt 遵从 · 图中文字 价格: 按张计费,写实级 (实时费率) GPT-Image 2 是 OpenAI 的写实生成器。和 Nano Banana 拉开距离的是 prompt following —— 当你的 brief 写着「水壶在左边、马克杯在 右边、两者都冒着蒸汽」时,GPT-Image 2 对空间关系的尊重比大多数 写实方案要好。纯材质保真上,Nano Banana Pro 和 2 还是更胜一筹; 要指令服从,这通常就是对的选择。

Request

curl https://llm.bytespike.ai/v1/images/generations \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "model": "gpt-image-2",
    "prompt": "A kettle on the left and a mug on the right, both steaming, on a marble counter",
    "size": "1024x1024",
    "quality": "high"
  }'

Body 参数

FieldTypeRequiredDefaultNotes
modelstringyesgpt-image-2
promptstringyes针对英文调优。
sizestringno1024x1024支持:1024x10241024x15361536x10242048x20484096x4096
nintegerno11–4 张。
qualitystringno"medium""low" / "medium" / "high" / "auto"
stylestringno"natural""natural" / "vivid"
output_formatstringno"png""png" / "webp" / "jpeg"
output_compressionintegerno0–100,仅对 webp / jpeg 生效。

Response

{
  "created": 1715174400,
  "data": [
    {
      "url": "https://cdn.bytespike.ai/img/...",
      "revised_prompt": "..."
    }
  ]
}
URL 预签名,24h 有效。

代码示例

curl https://llm.bytespike.ai/v1/images/generations \
  -H "Authorization: Bearer $BYTESPIKE_API_KEY" \
  -H "content-type: application/json" \
  -d '{"model": "gpt-image-2", "prompt": "Kettle and mug...", "quality": "high"}'

错误

Code触发条件计费?
400 / 401 / 402 / 403标准不计费
451prompt 被上游安全过滤拦截不计费
5xx上游问题不计费(自动重试)

何时选用

限制

限制
最大输出分辨率4096×4096
单次最大张数(n4
支持 init image(img2img)
支持 quality 修饰
支持 style 修饰
同步?是(典型 ≤30s,高质量更久)
1024² high 平均延迟12-18s