> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aiid.edu.kg/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`

Kling 専用拡張パラメータ：
- `model_name`
- `element_list`
- `result_type`
- `series_amount`
- `human_image`
- `cloth_image`
- `up_expansion_ratio`
- `down_expansion_ratio`
- `left_expansion_ratio`
- `right_expansion_ratio`

### 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 Kling 汎用画像メインモデル

公開メインモデル：
- `kling-image`

必須：
- `model`
- `model_name`

サポートされる `model_name`：
- `kling-v1`
- `kling-v1-5`
- `kling-v2`
- `kling-v2-new`
- `kling-v2-1`
- `kling-v3`

機能説明：
- テキストから画像生成：`model + model_name + prompt`
- 画像から画像生成：テキストから画像生成をベースに `image` を追加
- 複数画像から画像生成：`subject_image_list` を渡すか、複数の `image_urls/images` を渡します
- アウトペイント：`image` とアウトペイント比率パラメータを渡します

よく使うパラメータ：
- `image`
- `subject_image_list`
- `scene_image`
- `style_image`
- `aspect_ratio`
- `resolution`
- `up_expansion_ratio`
- `down_expansion_ratio`
- `left_expansion_ratio`
- `right_expansion_ratio`

例:

```json
{
  "model": "kling-image",
  "model_name": "kling-v3",
  "prompt": "海边日落，电影感人像",
  "aspect_ratio": "16:9",
  "n": 1
}
```

### 3.4 Kling Omni画像メインモデル

公開メインモデル：
- `kling-omni-image`

必須：
- `model`
- `model_name`

サポートされる `model_name`：
- `kling-image-o1`
- `kling-v3-omni`

よく使うパラメータ：
- `image_list`
- `element_list`
- `resolution`
- `aspect_ratio`
- `result_type`
- `series_amount`

例:

```json
{
  "model": "kling-omni-image",
  "model_name": "kling-v3-omni",
  "prompt": "生成一张海边跳舞的图片",
  "element_list": [
    {
      "element_id": 835266081714884677
    }
  ]
}
```

### 3.5 Kling バーチャル試着モデル

公開モデル：
- `kolors-virtual-try-on-v1`
- `kolors-virtual-try-on-v1-5`

最小入力パラメータ：
- `model + human_image + cloth_image`

説明：
- これら2つのモデル自体が完全なメインモデルであるため、`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/ja/openapi.json POST /v1/images/edits
openapi: 3.0.0
info:
  title: 出海营 API 参考ドキュメント
  version: 1.0.0
  description: Public AI Gateway API Reference
servers:
  - url: https://api.aiid.edu.kg
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: Video generation Seedance
  - name: 動画生成Sora対応形式
  - name: Video generation 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`

        Kling 専用拡張パラメータ：
        - `model_name`
        - `element_list`
        - `result_type`
        - `series_amount`
        - `human_image`
        - `cloth_image`
        - `up_expansion_ratio`
        - `down_expansion_ratio`
        - `left_expansion_ratio`
        - `right_expansion_ratio`

        ### 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 Kling 汎用画像メインモデル

        公開メインモデル：
        - `kling-image`

        必須：
        - `model`
        - `model_name`

        サポートされる `model_name`：
        - `kling-v1`
        - `kling-v1-5`
        - `kling-v2`
        - `kling-v2-new`
        - `kling-v2-1`
        - `kling-v3`

        機能説明：
        - テキストから画像生成：`model + model_name + prompt`
        - 画像から画像生成：テキストから画像生成をベースに `image` を追加
        - 複数画像から画像生成：`subject_image_list` を渡すか、複数の `image_urls/images` を渡します
        - アウトペイント：`image` とアウトペイント比率パラメータを渡します

        よく使うパラメータ：
        - `image`
        - `subject_image_list`
        - `scene_image`
        - `style_image`
        - `aspect_ratio`
        - `resolution`
        - `up_expansion_ratio`
        - `down_expansion_ratio`
        - `left_expansion_ratio`
        - `right_expansion_ratio`

        例:

        ```json
        {
          "model": "kling-image",
          "model_name": "kling-v3",
          "prompt": "海边日落，电影感人像",
          "aspect_ratio": "16:9",
          "n": 1
        }
        ```

        ### 3.4 Kling Omni画像メインモデル

        公開メインモデル：
        - `kling-omni-image`

        必須：
        - `model`
        - `model_name`

        サポートされる `model_name`：
        - `kling-image-o1`
        - `kling-v3-omni`

        よく使うパラメータ：
        - `image_list`
        - `element_list`
        - `resolution`
        - `aspect_ratio`
        - `result_type`
        - `series_amount`

        例:

        ```json
        {
          "model": "kling-omni-image",
          "model_name": "kling-v3-omni",
          "prompt": "生成一张海边跳舞的图片",
          "element_list": [
            {
              "element_id": 835266081714884677
            }
          ]
        }
        ```

        ### 3.5 Kling バーチャル試着モデル

        公開モデル：
        - `kolors-virtual-try-on-v1`
        - `kolors-virtual-try-on-v1-5`

        最小入力パラメータ：
        - `model + human_image + cloth_image`

        説明：
        - これら2つのモデル自体が完全なメインモデルであるため、`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
                    - kling-image
                    - kling-omni-image
                    - 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
                    - kling-image
                    - kling-omni-image
                    - 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
              kling_text2img:
                summary: Kling テキストから画像を生成
                value:
                  model: kling-image
                  model_name: kling-v3
                  prompt: 海边日落，电影感人像
                  aspect_ratio: '16:9'
                  'n': 1
              kling_img2img:
                summary: Kling 画像から画像へ
                value:
                  model: kling-image
                  model_name: kling-v2-1
                  prompt: 改成赛博朋克夜景风格
                  image: https://example.com/input.png
                  'n': 1
              kling_omni_image:
                summary: Kling Omni 画像
                value:
                  model: kling-omni-image
                  model_name: kling-v3-omni
                  prompt: 生成一张海边跳舞的图片
                  element_list:
                    - element_id: 835266081714884700
              kling_virtual_try_on:
                summary: Kling バーチャル試着
                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`

````