Skip to main content
POST
cURL
使用此端点可通过 CometAPI 创建异步 Kling Omni Image 任务。创建请求会返回 task_id;请使用 获取 Kling Omni 图像任务 轮询任务,直至生成图像 URL 可用。
有关完整的提供商参数参考,请参阅 Kling Image O1 文档.

选择请求格式

  • 单图生成:发送 promptimage_listresolutionresult_type: singlenaspect_ratio
  • 带水印输出:当需要在查询响应中获得带水印的结果 URL 时,添加 watermark_info.enabled: true
  • 模型 ID:省略 model_name 以使用路由默认值,或发送经过测试的 Omni Image 模型 ID,例如 kling-image-o1kling-v3-omni
参考图像使用包含 image_list 字段的 image 项。Prompt 可以按索引引用它们,例如第一个项使用 <<<image_1>>>,第二个项使用 <<<image_2>>>

任务流程

1

创建任务

提交 POST /kling/v1/images/omni-image 并存储返回的 data.task_id
2

查询任务

轮询 GET /kling/v1/images/omni-image/ 直至 data.task_statussucceedfailed
3

持久化图像

任务成功后,如需持久访问,请将 data.task_result.images[].url 复制到您自己的存储中。
有关完整的响应架构和任务状态详情,请参阅 获取 Kling Omni 图像任务。以下请求查询一次单个任务:

结果字段

成功的查询响应会在 data.task_result.images 下返回生成的图像。每个项可以包含: 生成的资源 URL 可能会过期,或被提供商服务清除。当工作流需要长期保留时,请将完成的图像存储在您自己的存储层中。

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI API key.

请求头

Content-Type
string

Must be application/json.

请求体

application/json
prompt
string
必填

Text prompt for the generated image. The prompt can reference images with <<<image_1>>>, <<<image_2>>>, and matching indexes from image_list. Maximum length is 2,500 characters.

model_name
string

Optional model ID for this Omni Image request. Omit this field to use the route default.

image_list
object[]

Reference images that the prompt can cite with <<<image_1>>>, <<<image_2>>>, and so on. Keep the total number of reference images within the provider limits for the selected model.

resolution
enum<string>
默认值:1k

Requested output resolution. Use 1k, 2k, or 4k; omitted requests use 1k.

可用选项:
1k,
2k,
4k
result_type
enum<string>
默认值:single

Use single for a single-image task.

可用选项:
single
n
integer
默认值:1

Number of single-image results to generate. Range: 1 to 9.

必填范围: 1 <= x <= 9
aspect_ratio
enum<string>
默认值:auto

Requested output aspect ratio in width:height format. Use auto to let the provider choose from the prompt and references.

可用选项:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9,
auto
watermark_info
object

Watermark options. When enabled is true, the task can return watermarked result URLs in addition to the original result URLs.

callback_url
string<uri>

Webhook URL that receives task status notifications when the task status changes. Omit this field to poll manually.

external_task_id
string

User-defined task ID for your own tracking. It does not replace the system-generated task_id and must be unique per account.

响应

200 - application/json

Task accepted.

code
integer
必填

Response code. 0 means the task request was accepted.

message
string
必填

Response message.

data
object
必填
request_id
string

Request identifier returned by CometAPI when present.

最后修改于 2026年7月31日