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

# GPT-Image-1

GPT Image 1 是 OpenAI 的图像生成模型，它是一个原生的多模态语言模型，既能接收文本和图像输入，也能生成图像输出。

另外，GPT-Image-1 还有一个低价经济版本 `gpt-image-1-mini`， 调用方式和 GPT-Image-1 完全一样，不再单独列举，在本教程演示示例中将模型名称替换即可。

### 模型参数

* 模型ID：`gpt-image-1`/`gpt-image-1-mini`
* 模型价格：你可以在[模型广场](https://geekai.co/models?platform=openai\&type=image)查看最新价格信息
* 调用入口：`https://geekai.co/api/v1/images/generations`
* 模型参数：参考[画图 API 手册](https://docs.geekai.co/cn/api/image/generations)
* API认证：[获取 API KEY](https://docs.geekai.co/cn/docs/quick_start)

<Note>
  不支持画图公共 API 中的以下参数：

  * `negative_prompt`
  * `seed`
  * `strength`
  * `aspect_ratio`
  * `style_preset`

  附：[GPT-Image-1 官方 API 文档](https://platform.openai.com/docs/guides/image-generation)
</Note>

GPT-Image-1 支持的 `size` 尺寸如下：

* `1024x1024`
* `1024x1536`
* `1536x1024`

### 模型价格

不同尺寸和质量对应的价格不同，以下是 GPT-Image-1 的价格表：

| 质量（quality） | 尺寸（size）  | 价格（单位：元/张） |
| ----------- | --------- | ---------- |
| low         | 1024x1024 | 0.095      |
| low         | 1024x1536 | 0.126      |
| low         | 1536x1024 | 0.126      |
| medium      | 1024x1024 | 0.315      |
| medium      | 1024x1536 | 0.473      |
| medium      | 1536x1024 | 0.473      |
| high        | 1024x1024 | 1.26       |
| high        | 1024x1536 | 1.89       |
| high        | 1536x1024 | 1.89       |

GPT-Image-1 模型参数默认值 `quality` 是 `medium`，`size` 是 `1024x1024`。

使用极客智坊提供的[低价代理渠道](https://docs.geekai.co/cn/docs/model_price)调用时，不同参数对应价格按照价格表x对应的折扣值即可：以高可用默认通道为例，折扣值是 `0.5`，那么生成一张 `size` 为 `1024x1024`、`quality` 为 `medium` 的图片价格是 `0.315 x 0.5 = 0.158` 元，如果生成同样尺寸但 `quality` 为 `high` 的图片价格是 `1.26 x 0.5 = 0.63` 元。其他参数依次类推。

GPT-Image-1 mini 的价格表如下：

| 质量（quality） | 尺寸（size）  | 价格（单位：元/张） |
| ----------- | --------- | ---------- |
| low         | 1024x1024 | 0.041      |
| low         | 1024x1536 | 0.049      |
| low         | 1536x1024 | 0.049      |
| medium      | 1024x1024 | 0.082      |
| medium      | 1024x1536 | 0.123      |
| medium      | 1536x1024 | 0.123      |
| high        | 1024x1024 | 0.287      |
| high        | 1024x1536 | 0.410      |
| high        | 1536x1024 | 0.410      |

GPT-Image-1 mini 模型参数默认值和 GPT-Image-1 一样，`quality` 是 `medium`，`size` 是 `1024x1024`，渠道代理价格计算也和 GPT-Image-1 一样，只需将价格表x对应的折扣值乘以即可。

### 文生图片

通过文字描述来生成对应图像：

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"gpt-image-1",
    "prompt":"画一只可爱的小猫在草丛中玩耍"
}'
```

### 以图生图

**单图**

基于已有图片，结合文字指令进行图像编辑，生成新的图像：

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"gpt-image-1",
    "prompt":"修复这张破损的照片",
    "image":"https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"
}'
```

**多图**

基于多张参考图片，融合它们的风格、元素等特征来生成新图像，如衣裤鞋帽与模特图融合成穿搭图，人物与风景融合为人物风景图等：

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/images/edits' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model":"gpt-image-1",
    "prompt": "将图1中的面料应用至图2的服装上，图片比例按照图2来",
    "image": [
        "https://style3d-render.oss-cn-hangzhou.aliyuncs.com/test/针织.jpg",
        "https://style3d-render.oss-cn-hangzhou.aliyuncs.com/test/款式图.jpg"
    ]
    "quality": "high"
}'
```

注意，GPT-Image-1 支持图片编辑接口，要借助图片编辑接口实现图生图功能，请参考[图片编辑文档](https://docs.geekai.co/cn/docs/image/edit)。

### 异步任务

对于高质量耗时图片任务，建议通过极客智坊提供的异步任务模式生成图像。

[画图 API](https://docs.geekai.co/cn/api/image/generations) 中的 `async` 参数用于控制是否异步生成图像，默认为 `false`，表示创建图像接口会同步等待图像生成完毕并返回。如果设置为 `true`，则会异步生成图像并返回任务ID，你可以使用该任务ID轮询图像生成状态。
