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

# Omni 图像

> 接口与可灵官网一致；Omni Image (O1)

* 路径 `POST /kling/v1/images/omni-image`
* 与官网一致：本页所有请求体、字段命名与返回结构与可灵官网保持一致
* 字段详解：请参考[官网权威文档](https://klingai.kuaishou.com/docs)

请求参数

| 参数                 | 类型     | 必填    | 说明                                                            |
| ------------------ | ------ | ----- | ------------------------------------------------------------- |
| `model_name`       | string | 否     | 模型名称，默认 `kling-image-o1`                                      |
| `prompt`           | string | **是** | 文本提示词                                                         |
| `image_list`       | array  | 否     | 参考图片列表                                                        |
| `element_list`     | array  | 否     | 主体参考列表                                                        |
| `resolution`       | string | 否     | 清晰度：`1k`/`2k`                                                 |
| `n`                | int    | 否     | 生成图片数量 \[1,9]                                                 |
| `aspect_ratio`     | string | 否     | 纵横比：`16:9`、`9:16`、`1:1`、`4:3`、`3:4`、`3:2`、`2:3`、`21:9`、`auto` |
| `watermark_info`   | object | 否     | 是否生成含水印结果                                                     |
| `callback_url`     | string | 否     | 回调通知地址                                                        |
| `external_task_id` | string | 否     | 自定义任务ID                                                       |

请求体补充说明

* `prompt`：支持通过 `<<<image_1>>>` 引用图片占位符；长度 ≤ 2500 字符
* `model_name` 仅支持 `kling-image-o1`。
* `image_list` 结构：
  * 字段：`image`（URL 或 Base64，官方上游字段）
  * 兼容：`image_url`（平台兼容输入，转发上游时会映射为 `image`）
  * 约束：`.jpg/.jpeg/.png`；大小 ≤ 10MB；最小边 ≥ 300px；宽高比 1:2.5 \~ 2.5:1
* `element_list` 结构：`[{ "element_id": <ID> }]`
  * 参考图片数量 + 主体数量 ≤ 10
* `resolution`：默认 `1k`；`n` 默认 1
* `aspect_ratio`：
  * 默认 `auto`，按输入内容智能生成
  * 当以参考图原始比例生成时，该参数不生效

### 场景一：图片参考生成

```bash theme={null}
curl --request POST \
  --url https://models.hingnet.com.cn/kling/v1/images/omni-image \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "model_name": "kling-image-o1",
    "prompt": "<<<image_1>>>同风格的科幻城市",
    "image_list": [
      {"image": "https://example.com/ref.jpg"}
    ],
    "aspect_ratio": "16:9",
    "resolution": "1k",
    "n": 1
  }'
```

示例响应（创建任务）

```json theme={null}
{
  "code": 0,
  "message": "success",
  "request_id": "req_...",
  "data": {
    "task_id": "task_01...",
    "task_status": "submitted",
    "created_at": 1735558800000,
    "updated_at": 1735558800000
  }
}
```
