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

# GPT Image 1.5 图像编辑

> GPT Image 1.5 图像编辑 API 通过文字指令、参考图和可选蒙版，对图像中的选定区域进行有针对性的修改。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

使用 GPT Image 1.5，通过文字指令、参考图和可选蒙版对选定区域进行有针对性的图像修改。

## 模型

* **openai/gpt-image-1.5/edit** - 使用提示词和参考图编辑图像。

## 功能

* 使用提示词和参考图编辑图像。
* `image_urls` 至少接受 1 张图像。
* 每次编辑请求生成一张图像，并按一张计费。

## 输出选项

### 图像尺寸

* `size`：可选。可选值：`1024x1024`、`1024x1536`、`1536x1024`。默认：`1024x1024`。

### 图像数量

* `n`：可选的兼容参数。可选值：`1`、`2`、`3`、`4`。默认：`1`。每次编辑请求只生成一张图像并按一张计费；更大的值不会增加输出数量。

## 高级参数

`model` 和可选的 `callback_url` 放在请求根级。所有工作流参数（包括输出选项）都放在 `input` 内。

### 提示词

* `prompt`：必填。描述要做的修改。长度：**1-1,000 个字符**。
* 至少包含一个非空白字符。

### 图像 URL

* `image_urls`：必填。提供公开可访问的图像 URL。至少 1 项。每项都必须是 HTTP(S) URL。

### 蒙版 URL

* `mask_url`：可选。蒙版图的公开可访问 HTTP(S) URL，用于选定要编辑的区域。


## OpenAPI

````yaml zh/api-manual/image-series/openai-gpt-image-1-5-edit.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - GPT Image 1.5 图像编辑
  description: 使用 GPT Image 1.5，通过文字指令、参考图和可选蒙版对选定区域进行有针对性的图像修改。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Image Series
      summary: GPT Image 1.5 图像编辑
      description: 提交 GPT Image 1.5 任务：model 和可选的 callback_url 放在请求根级，生成参数放在 input 内。
      operationId: submit_openai_gpt_image_1_5_edit
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - input
              additionalProperties: true
              properties:
                model:
                  type: string
                  example: openai/gpt-image-1.5/edit
                  enum:
                    - openai/gpt-image-1.5/edit
                input:
                  type: object
                  required:
                    - image_urls
                    - prompt
                  properties:
                    prompt:
                      type: string
                      maxLength: 1000
                      minLength: 1
                      description: 描述要对图像做的修改，1–1,000 个字符，且至少包含一个非空白字符。
                    image_urls:
                      type: array
                      items:
                        type: string
                        format: uri
                        description: 公开可访问的 HTTP(S) 图像 URL。
                      minItems: 1
                      description: 要编辑的参考图。至少提供一个公开可访问的 HTTP(S) 图像 URL。
                    size:
                      type: string
                      enum:
                        - 1024x1024
                        - 1024x1536
                        - 1536x1024
                      default: 1024x1024
                      description: 输出图像尺寸（像素）。默认 1024x1024。
                    'n':
                      type: integer
                      enum:
                        - 1
                        - 2
                        - 3
                        - 4
                      minimum: 1
                      description: 兼容参数，取值 1 到 4，默认 1。每次编辑请求只生成一张图像并按一张计费；更大的值不会增加输出数量。
                      default: 1
                    mask_url:
                      type: string
                      format: uri
                      description: 公开可访问的蒙版图 HTTP(S) URL，用于选定要编辑的区域。
                  additionalProperties: false
                callback_url:
                  type: string
                  nullable: true
                  description: 公开的 HTTP(S) URL，任务变为 finished 或 failed 时会向其发送 POST 通知。
              description: model 和可选的 callback_url 放在请求根级，生成参数放在 input 内。
            examples:
              basic:
                summary: 基础流程
                value:
                  model: openai/gpt-image-1.5/edit
                  input:
                    image_urls:
                      - https://example.com/image.png
                    prompt: Replace the sky with a starry night sky.
                    size: 1024x1024
                    'n': 1
              callback:
                summary: 接收完成回调
                value:
                  model: openai/gpt-image-1.5/edit
                  input:
                    image_urls:
                      - https://example.com/image.png
                    prompt: Replace the sky with a starry night sky.
                    size: 1024x1024
                    'n': 1
                  callback_url: https://your-domain.com/callback
      responses:
        '200':
          description: 任务已提交
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - data
                properties:
                  code:
                    type: integer
                    enum:
                      - 200
                  data:
                    type: object
                    required:
                      - task_id
                      - status
                      - created_time
                    properties:
                      task_id:
                        type: string
                      status:
                        type: string
                        enum:
                          - not_started
                          - running
                          - finished
                          - failed
                      created_time:
                        type: string
                        format: date-time
              example:
                code: 200
                data:
                  task_id: task-unified-example
                  status: running
                  created_time: '2026-09-10T08:00:00'
        '400':
          description: 请求校验错误或账户余额不足
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '401':
          description: 凭证无效
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '403':
          description: 拒绝访问
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '404':
          description: 模型未知或已停用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '408':
          description: 请求超时
          content:
            text/plain:
              schema:
                type: string
              example: Request timeout
        '422':
          description: JSON 无效或请求体不是对象
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '429':
          description: 超出速率限制或 API Key 积分限额
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '500':
          description: 内部错误
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '502':
          description: 任务创建错误
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
        '503':
          description: 模型服务暂时不可用
          content:
            application/json:
              schema:
                type: object
                required:
                  - detail
                properties:
                  detail:
                    oneOf:
                      - type: string
                      - type: object
                        additionalProperties: true
                      - type: array
                        items: {}
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 使用 VIDGO_API_KEY。

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.