返回模型列表

GPT Image 2

openaiopenai/gpt-image-2

供应商自营与 TheRouter 服务形态的差异

供应商自己运营时

OpenAI 通过 /v1/images/generations 和 /v1/images/edits 提供直接的 gpt-image-2 调用;其模型页面标注该模型 ID 本身不支持 /v1/responses 和 /v1/chat/completions。

在 TheRouter 上

TheRouter 在 https://api.therouter.ai/v1 下以路由模型 ID openai/gpt-image-2 暴露相同的图像生成和图像编辑接口。因此示例保留 OpenAI SDK 形态,但更换 baseURL、API key 和模型 slug。

媒体生成能力

image_generation
sizes
  • 1024x1024
  • 1024x1536
  • 1536x1024
qualities
  • low
  • medium
  • high
max_outputs_per_request
4
output_formats
  • png
  • jpeg
  • webp
defaults
size
1024x1024
quality
medium
image_edit
sizes
  • 1024x1024
  • 1024x1536
  • 1536x1024
qualities
  • low
  • medium
  • high
max_reference_images
4
output_formats
  • png
  • jpeg
  • webp
defaults
size
1024x1024
quality
medium

API 使用指南

图像生成

使用标准的 OpenAI Images API 从文本提示生成图像。支持 2K 分辨率、质量等级、输出格式选择、透明背景以及每批最多 8 张图像。

cURL
curl https://api.therouter.ai/v1/images/generations \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "openai/gpt-image-2",
    "prompt": "A serene mountain landscape at sunset, photorealistic style",
    "n": 1,
    "size": "2048x2048",
    "quality": "medium",
    "output_format": "png"
  }'

图像编辑

使用文本提示和参考图像编辑现有图像。支持高保真图像输入、遮罩编辑和多图像合成。

cURL
curl https://api.therouter.ai/v1/images/edits \
  -H "Authorization: Bearer $THEROUTER_API_KEY" \
  -F "model=openai/gpt-image-2" \
  -F "image=@input.png" \
  -F "prompt=Replace the sky with a starry night sky, keep the foreground unchanged" \
  -F "size=2048x2048"

近期动态

事实档案 — 本页每条断言可在此回溯来源
来源URL采集于
发布日期openai.com ↗2026-05-29已核实
最大分辨率developers.openai.com ↗2026-08-04已核实
宽高比developers.openai.com ↗2026-08-04已核实
输出格式developers.openai.com ↗2026-08-04已核实
知识截止日期developers.openai.com ↗2026-08-04未知
思考模式openai.com ↗2026-05-29已核实
每次提示的图像数developers.openai.com ↗2026-08-04未知
许可——已核实
Image Arena — Text-to-Image (overall)arena.ai ↗2026-08-04已核实
Image Arena — Single-Image Editarena.ai ↗2026-08-04已核实
Image Arena — Multi-Image Editarena.ai ↗2026-08-04已核实
Image Arena — Text Rendering sub-categoryarena.ai ↗2026-08-04已核实
Image Arena — Product, Branding & Commercial Designarena.ai ↗2026-08-04已核实
Image Arena — Portraits sub-categoryarena.ai ↗2026-08-04已核实
OpenAI 发布 ChatGPT Images 2.0 和 gpt-image-2 — 推理驱动的图像生成openai.com ↗2026-05-29已核实
gpt-image-2 与 gpt-image-1.5 有什么不同?openai.com ↗2026-05-29待核实
gpt-image-2 支持哪些分辨率和宽高比?felloai.com ↗2026-05-29待核实
gpt-image-2 与我现有的 DALL·E 3 集成兼容吗?gptimage2.design ↗2026-05-29待核实
帮助与联系