> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heihuzi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GPT Image 2 图像生成

> 使用 gpt-image-2 生成图片时的选择和限制。

GPT Image 2 使用 `/v1/images/generations`。它适合把文本提示词直接生成图片。

## 尺寸

优先使用明确像素尺寸，例如 `1024x1024`、`2048x1152`、`3840x2160`。如果不确定尺寸，可以使用 `auto`，但最终效果取决于上游模型和服务端校验。

## 输出

响应通常返回 OpenAI Images 兼容结构。图片可能以 URL 或 base64 形式返回，取决于上游能力和渠道配置；不要依赖 `response_format` 强制指定 GPT Image 2 的返回形态。

## 权限

如果返回 403，通常是 API Key 所属分组没有开启图片生成能力。先确认 `/v1/models` 能看到 `gpt-image-2`，再检查分组能力。

## 不适合的场景

* 需要编辑已有图片时，应使用图像编辑接口。
* 需要 Claude Code 协议时，不应调用 Images。
* 当前公开文档不提供异步任务轮询流程。
