> ## 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.5

GPT Image 1.5 是 OpenAI 最新推出的图像生成模型，能够更准确地理解和执行指令。

### 模型参数

* 模型ID：`gpt-image-1.5`
* 模型价格：你可以在[模型广场](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.5 官方 API 文档](https://developers.openai.com/api/docs/guides/image-generation)
</Note>

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

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

### 模型价格

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

| 质量（quality） | 尺寸（size）  | 价格（单位：元/张） |
| ----------- | --------- | ---------- |
| low         | 1024x1024 | 0.077      |
| low         | 1024x1536 | 0.102      |
| low         | 1536x1024 | 0.102      |
| medium      | 1024x1024 | 0.255      |
| medium      | 1024x1536 | 0.383      |
| medium      | 1536x1024 | 0.383      |
| high        | 1024x1024 | 1.02       |
| high        | 1024x1536 | 1.53       |
| high        | 1536x1024 | 1.53       |

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

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

### 文生图片

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

```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.5",
    "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.5",
    "prompt":"修复这张破损的照片",
    "image":"https://static.geekai.co/storage/2025/04/02/broken-picture.jpg"
}'
```

<Note>
  `image` 参数支持传入图片链接或图片的 Base64 编码字符串。
</Note>

**多图**

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

```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.5",
    "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",
    "background": "auto",
    "output_format": "png",
    "response_format": "url",
    "async": true
}'
```

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

<Note>
  对于耗时生图任务，可以通过设置 `async` 参数为 `true` 开启异步任务模式。异步任务模式下，画图接口会返回一个 `task_id`，你可以通过轮询 `https://geekai.co/api/v1/images/{task_id}` 来获取图像生成的最新状态，当任务完成后即可获得最终的图像URL，相关细节请参考[异步生图](https://docs.geekai.co/cn/docs/image/txt2img#异步生图)。
</Note>
