feat(kling): 接入O1与3.0 Omni兼容接口
ci / verify (pull_request) Successful in 15m32s

新增中国区可灵 V1 AK/SK Omni 协议与 API 2.0 兼容路径,补齐任务隔离、外部任务幂等、参数校验和 OpenAPI 文档。\n\n验证:O1 与 3.0 Omni 真实 V1 任务成功;Go、前端、依赖审计、迁移及 CI 脚本门禁通过。
This commit is contained in:
2026-07-21 23:47:13 +08:00
parent e280c0875c
commit 9d4501bc42
15 changed files with 2113 additions and 23 deletions
+177
View File
@@ -1984,6 +1984,8 @@ definitions:
type: string
executionLeaseExpiresAt:
type: string
externalTaskId:
type: string
finalChargeAmount:
type: number
finishedAt:
@@ -8491,6 +8493,181 @@ paths:
summary: 创建或执行 AI 任务
tags:
- tasks
/kling/omni-video/{model}:
post:
consumes:
- application/json
description: 兼容可灵 API 2.0 的模型路径;调用方使用网关 API Key,网关转换并使用中国区 V1 AK/SK 上游。
parameters:
- description: 模型路径(kling-o1 或 kling-v3-omni
in: path
name: model
required: true
type: string
- description: 可灵 API 2.0 请求
in: body
name: input
required: true
schema:
additionalProperties: true
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties: true
type: object
"401":
description: Unauthorized
schema:
$ref: '#/definitions/httpapi.ErrorEnvelope'
security:
- BearerAuth: []
summary: 创建可灵 API 2.0 Omni 视频任务
tags:
- kling-compatible
/kling/tasks:
get:
parameters:
- description: 逗号分隔的任务 ID
in: query
name: task_ids
type: string
- description: 逗号分隔的外部任务 ID
in: query
name: external_task_ids
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 按 ID 查询可灵 API 2.0 任务
tags:
- kling-compatible
post:
consumes:
- application/json
parameters:
- description: 游标、数量、时间范围和筛选条件
in: body
name: input
required: true
schema:
additionalProperties: true
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 分页查询可灵 API 2.0 任务
tags:
- kling-compatible
/kling/v1/videos/omni-video:
get:
parameters:
- default: 1
description: 页码
in: query
name: pageNum
type: integer
- default: 30
description: 每页数量
in: query
name: pageSize
type: integer
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 分页查询可灵 V1 Omni 视频任务
tags:
- kling-compatible
post:
consumes:
- application/json
description: 兼容中国区可灵 V1 /v1/videos/omni-video;用户使用网关 API Key,网关在服务端使用 AK/SK
调用上游。
parameters:
- description: 可灵 V1 Omni 请求
in: body
name: input
required: true
schema:
additionalProperties: true
type: object
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"400":
description: Bad Request
schema:
additionalProperties: true
type: object
"401":
description: Unauthorized
schema:
$ref: '#/definitions/httpapi.ErrorEnvelope'
security:
- BearerAuth: []
summary: 创建可灵 V1 Omni 视频任务
tags:
- kling-compatible
/kling/v1/videos/omni-video/{taskID}:
get:
parameters:
- description: 任务 ID
in: path
name: taskID
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
additionalProperties: true
type: object
"404":
description: Not Found
schema:
additionalProperties: true
type: object
security:
- BearerAuth: []
summary: 查询可灵 V1 Omni 视频任务
tags:
- kling-compatible
/music/generations:
post:
consumes: