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

# 編輯圖像（OpenAI Dall-E 相容）

> OpenAI Dall-E 格式圖片編輯介面。

- `POST /v1/images/edits`：編輯圖片

標準鑑權標頭：
- `Content-Type: application/json`

- `model: string`：必填，對外模型名稱
- `prompt: string`：推薦，圖片生成描述
- `n: number`：可選，生成張數
- `size: string`：可選，尺寸或解析度表達
- `quality: string`：可選，品質等級
- `response_format: string`：可選，回傳格式

常用相容擴展參數：
- `image`
- `image_url`
- `image_urls`
- `image_list`
- `subject_image_list`
- `scene_image`
- `style_image`
- `negative_prompt`
- `aspect_ratio`
- `resolution`
- `callback_url`
- `external_task_id`

### 3.1 Nano Banana 系列

對外模型：
- `nano-banana`
- `nano-banana-pro`
- `nano-banana-pro-2k`
- `nano-banana-pro-4k`
- `nano-banana-2`
- `nano-banana-2-2k`
- `nano-banana-2-4k`

能力說明：
- `nano-banana`：基礎文字生圖，也相容圖片編輯
- `nano-banana-pro*`：更高品質版本
- `nano-banana-2*`：更新版本系列
- `*-2k` / `*-4k`：高解析度型號

常用參數：
- 文生圖：`model + prompt`
- 圖片編輯：`model + prompt + image`，也相容 `image_urls`
- 常用擴展：`n` `size` `quality` `response_format`

範例：

```json
{
  "model": "nano-banana",
  "prompt": "a cute cat running in cloud",
  "n": 1,
  "size": "1024x1792"
}
```

```json
{
  "model": "nano-banana-pro",
  "prompt": "把主体改成赛博朋克夜景",
  "image": "https://example.com/input.png",
  "n": 1
}
```

### 3.2 Seedream 系列

對外模型：
- `doubao-seedream-3-0-t2i-250415`
- `doubao-seedream-4-0-250828`
- `doubao-seedream-4-5-251128`
- `doubao-seedream-5-0-260128`

能力說明：
- 統一按文生圖呼叫
- 建議優先傳入標準參數：`prompt + model + size/aspect_ratio`

常用參數：
- `model + prompt`
- 可選：`size` `aspect_ratio` `n`

### 3.3 Kolors 虛擬試衣

這是獨立的虛擬試衣服務，不屬於 Kling 影片模型版本。
支援 `kolors-virtual-try-on-v1`、`kolors-virtual-try-on-v1-5`。
最小輸入參數為 `model + human_image + cloth_image`，不需要 `model_name`。

```json
{
  "model": "kolors-virtual-try-on-v1",
  "human_image": "https://example.com/human.jpg",
  "cloth_image": "https://example.com/cloth.jpg"
}
```



## OpenAPI

````yaml api-reference/zh-tw/openapi.json POST /v1/images/edits
openapi: 3.0.0
info:
  title: NewAPIs API 參考文件
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.newapi.si
security:
  - BearerAuth: []
tags:
  - name: OpenAI格式（Chat）
  - name: OpenAI格式（Responses）
  - name: 圖片生成 Gemini 格式
  - name: 圖片生成OpenAI DALL-E 格式
  - name: 獲取模型列表
  - name: 影片生成HappyHorse與 Wan
  - name: 影片生成Kling格式
  - name: 影片生成 Omni 與 Veo 格式
  - name: 影片生成 Seedance 格式
  - name: 影片生成Sora相容格式
  - name: 影片生成 Vidu 格式
  - name: 音樂生成任務格式
paths:
  /v1/images/edits:
    post:
      tags:
        - 圖片生成OpenAI DALL-E 格式
      summary: 編輯圖像（OpenAI Dall-E 相容）
      description: |-
        OpenAI Dall-E 格式圖片編輯介面。

        - `POST /v1/images/edits`：編輯圖片

        標準鑑權標頭：
        - `Content-Type: application/json`

        - `model: string`：必填，對外模型名稱
        - `prompt: string`：推薦，圖片生成描述
        - `n: number`：可選，生成張數
        - `size: string`：可選，尺寸或解析度表達
        - `quality: string`：可選，品質等級
        - `response_format: string`：可選，回傳格式

        常用相容擴展參數：
        - `image`
        - `image_url`
        - `image_urls`
        - `image_list`
        - `subject_image_list`
        - `scene_image`
        - `style_image`
        - `negative_prompt`
        - `aspect_ratio`
        - `resolution`
        - `callback_url`
        - `external_task_id`

        ### 3.1 Nano Banana 系列

        對外模型：
        - `nano-banana`
        - `nano-banana-pro`
        - `nano-banana-pro-2k`
        - `nano-banana-pro-4k`
        - `nano-banana-2`
        - `nano-banana-2-2k`
        - `nano-banana-2-4k`

        能力說明：
        - `nano-banana`：基礎文字生圖，也相容圖片編輯
        - `nano-banana-pro*`：更高品質版本
        - `nano-banana-2*`：更新版本系列
        - `*-2k` / `*-4k`：高解析度型號

        常用參數：
        - 文生圖：`model + prompt`
        - 圖片編輯：`model + prompt + image`，也相容 `image_urls`
        - 常用擴展：`n` `size` `quality` `response_format`

        範例：

        ```json
        {
          "model": "nano-banana",
          "prompt": "a cute cat running in cloud",
          "n": 1,
          "size": "1024x1792"
        }
        ```

        ```json
        {
          "model": "nano-banana-pro",
          "prompt": "把主体改成赛博朋克夜景",
          "image": "https://example.com/input.png",
          "n": 1
        }
        ```

        ### 3.2 Seedream 系列

        對外模型：
        - `doubao-seedream-3-0-t2i-250415`
        - `doubao-seedream-4-0-250828`
        - `doubao-seedream-4-5-251128`
        - `doubao-seedream-5-0-260128`

        能力說明：
        - 統一按文生圖呼叫
        - 建議優先傳入標準參數：`prompt + model + size/aspect_ratio`

        常用參數：
        - `model + prompt`
        - 可選：`size` `aspect_ratio` `n`

        ### 3.3 Kolors 虛擬試衣

        這是獨立的虛擬試衣服務，不屬於 Kling 影片模型版本。
        支援 `kolors-virtual-try-on-v1`、`kolors-virtual-try-on-v1-5`。
        最小輸入參數為 `model + human_image + cloth_image`，不需要 `model_name`。

        ```json
        {
          "model": "kolors-virtual-try-on-v1",
          "human_image": "https://example.com/human.jpg",
          "cloth_image": "https://example.com/cloth.jpg"
        }
        ```
      operationId: createImageEdit
      parameters: []
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                model:
                  type: string
                  example: dall-e-2
                  description: 對外圖片模型名稱。
                  enum:
                    - nano-banana
                    - doubao-seedream-3-0-t2i-250415
                    - seedream-5.0-flash
                    - seedream-5.0-pro
                    - seedream-5.5
                    - kolors-virtual-try-on-v1
                    - kolors-virtual-try-on-v1-5
                image:
                  type: string
                  format: binary
                  description: 單張圖片輸入，常用於圖生圖與擴圖。
                mask:
                  type: string
                  format: binary
                  description: 選填遮罩圖
                prompt:
                  type: string
                  description: 圖片生成描述。
                'n':
                  type: integer
                  description: 生成張數。
                  default: 1
                size:
                  type: string
                  enum:
                    - 256x256
                    - 512x512
                    - 1024x1024
                  description: 尺寸或解析度表達。
                response_format:
                  type: string
                  description: 回傳格式。
                  enum:
                    - url
                    - b64_json
                user:
                  type: string
              required:
                - model
                - image
                - prompt
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  example: dall-e-2
                  description: 對外圖片模型名稱。
                  enum:
                    - nano-banana
                    - doubao-seedream-3-0-t2i-250415
                    - seedream-5.0-flash
                    - seedream-5.0-pro
                    - seedream-5.5
                    - kolors-virtual-try-on-v1
                    - kolors-virtual-try-on-v1-5
                image:
                  type: string
                  format: binary
                  description: 單張圖片輸入，常用於圖生圖與擴圖。
                mask:
                  type: string
                  format: binary
                  description: 選填遮罩圖
                prompt:
                  type: string
                  description: 圖片生成描述。
                'n':
                  type: integer
                  description: 生成張數。
                  default: 1
                size:
                  type: string
                  enum:
                    - 256x256
                    - 512x512
                    - 1024x1024
                  description: 尺寸或解析度表達。
                response_format:
                  type: string
                  description: 回傳格式。
                  enum:
                    - url
                    - b64_json
                user:
                  type: string
              required:
                - model
                - image
                - prompt
            examples:
              nano_banana_text2img:
                summary: Nano Banana 文生圖
                value:
                  model: nano-banana
                  prompt: a cute cat running in cloud
                  'n': 1
                  size: 1024x1792
              seedream_text2img:
                summary: Seedream 文生圖
                value:
                  model: doubao-seedream-3-0-t2i-250415
                  prompt: 一张电影感海边日落人像
                  size: 1536x1024
                  'n': 1
              seedream_canvas_generation:
                summary: Seedream 文生圖
                value:
                  model: seedream-5.5
                  prompt: A mountain lake in morning light.
                  size: 2k
              kolors_virtual_try_on:
                summary: Kolors 虛擬試衣
                value:
                  model: kolors-virtual-try-on-v1
                  human_image: https://example.com/human.jpg
                  cloth_image: https://example.com/cloth.jpg
      responses:
        '200':
          description: 成功產生圖片
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ImageResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ImageResponse:
      type: object
      properties:
        created:
          type: integer
        data:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
              b64_json:
                type: string
              revised_prompt:
                type: string
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |-
        使用 Bearer Token 認證。
        格式: `Authorization: Bearer sk-xxxxxx`

````

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