> ## 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/generations`：创建图片生成任务

标准鉴权头：
- `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`

说明：
- 这两个模型本身就是完整主模型，不需要再传 `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/cn/openapi.json POST /v1/images/generations
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: 视频生成Seedance格式
  - name: 视频生成Sora兼容格式
  - name: 视频生成Vidu格式
  - name: 音乐生成任务格式
paths:
  /v1/images/generations:
    post:
      tags:
        - 图片生成OpenAI DALL-E格式
      summary: 生成图像（OpenAI Dall-E兼容）
      description: |-
        OpenAI Dall-E格式图片生成接口。

        - `POST /v1/images/generations`：创建图片生成任务

        标准鉴权头：
        - `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`

        说明：
        - 这两个模型本身就是完整主模型，不需要再传 `model_name`

        示例：

        ```json
        {
          "model": "kolors-virtual-try-on-v1",
          "human_image": "https://example.com/human.jpg",
          "cloth_image": "https://example.com/cloth.jpg"
        }
        ```
      operationId: createImageGeneration
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  description: 对外图片模型名称。
                  example: dall-e-3
                  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
                prompt:
                  type: string
                  description: 图片生成描述。虚拟试衣模型可不传。
                'n':
                  type: integer
                  description: 生成张数。
                  default: 1
                size:
                  type: string
                  description: 尺寸或分辨率表达。
                  enum:
                    - 1024x1024
                    - 1024x1792
                    - 1792x1024
                quality:
                  type: string
                  description: 质量等级。
                  enum:
                    - standard
                    - hd
                style:
                  type: string
                  description: 风格
                  enum:
                    - vivid
                    - natural
                response_format:
                  type: string
                  description: 返回格式。
                  enum:
                    - url
                    - b64_json
                user:
                  type: string
                  description: 用户标识
              required:
                - model
                - 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`

````