docs(api): 同步模型权限与 Kling 接口契约

This commit is contained in:
2026-07-22 00:25:22 +08:00
parent d7951cfdd2
commit 24b778b3ba
2 changed files with 599 additions and 0 deletions
+358
View File
@@ -4971,6 +4971,49 @@
}
}
},
"/api/v1/api-keys/assignable-models": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "按当前用户自身的用户、租户和用户组权限返回可分配给 API Key 的启用模型,不受任何 API Key 权限规则影响。",
"produces": [
"application/json"
],
"tags": [
"api-keys"
],
"summary": "列出 API Key 可分配模型",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/httpapi.PlatformModelListResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
}
}
}
},
"/api/v1/api-keys/{apiKeyID}": {
"delete": {
"security": [
@@ -10516,6 +10559,139 @@
}
}
},
"/v1/videos/omni-video": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "兼容 Kling 旧版 /v1/videos/omni-videoBearer token 必须为 Gateway API Key。任务固定异步执行,返回的 task_id 为网关任务 ID。",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"kling-compatible"
],
"summary": "创建 Kling Omni 视频任务",
"parameters": [
{
"description": "Kling Omni 官方兼容请求",
"name": "input",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/httpapi.KelingOmniVideoRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"429": {
"description": "Too Many Requests",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"503": {
"description": "Service Unavailable",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
}
}
}
},
"/v1/videos/omni-video/{taskID}": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "按创建接口返回的网关 task_id 查询任务;仅允许创建任务的 Gateway 用户访问。",
"produces": [
"application/json"
],
"tags": [
"kling-compatible"
],
"summary": "查询 Kling Omni 视频任务",
"parameters": [
{
"type": "string",
"description": "网关任务 ID",
"name": "taskID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httpapi.KelingCompatibleEnvelope"
}
}
}
}
},
"/v1/voice_clone": {
"post": {
"security": [
@@ -11485,6 +11661,176 @@
}
}
},
"httpapi.KelingCompatibleEnvelope": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"example": 0
},
"data": {},
"message": {
"type": "string",
"example": "SUCCEED"
},
"request_id": {
"type": "string"
}
}
},
"httpapi.KelingOmniElementInput": {
"type": "object",
"properties": {
"element_id": {}
}
},
"httpapi.KelingOmniImageInput": {
"type": "object",
"properties": {
"image_url": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"first_frame",
"end_frame"
]
}
}
},
"httpapi.KelingOmniMultiPrompt": {
"type": "object",
"properties": {
"duration": {
"type": "string",
"example": "3"
},
"index": {
"type": "integer",
"example": 1
},
"prompt": {
"type": "string",
"example": "A wide establishing shot"
}
}
},
"httpapi.KelingOmniVideoInput": {
"type": "object",
"properties": {
"keep_original_sound": {
"type": "string",
"enum": [
"yes",
"no"
]
},
"refer_type": {
"type": "string",
"enum": [
"base",
"feature"
]
},
"video_url": {
"type": "string"
}
}
},
"httpapi.KelingOmniVideoRequest": {
"type": "object",
"properties": {
"aspect_ratio": {
"type": "string",
"enum": [
"16:9",
"9:16",
"1:1"
],
"example": "9:16"
},
"callback_url": {
"type": "string"
},
"duration": {
"type": "string",
"example": "5"
},
"element_list": {
"type": "array",
"items": {
"$ref": "#/definitions/httpapi.KelingOmniElementInput"
}
},
"external_task_id": {
"type": "string"
},
"image_list": {
"type": "array",
"items": {
"$ref": "#/definitions/httpapi.KelingOmniImageInput"
}
},
"mode": {
"type": "string",
"enum": [
"std",
"pro",
"4k"
],
"example": "pro"
},
"model_name": {
"type": "string",
"example": "kling-v3-omni"
},
"multi_prompt": {
"type": "array",
"items": {
"$ref": "#/definitions/httpapi.KelingOmniMultiPrompt"
}
},
"multi_shot": {
"type": "boolean",
"example": false
},
"prompt": {
"type": "string",
"example": "A quiet street in the rain with natural ambient sound"
},
"shot_type": {
"type": "string",
"example": "customize"
},
"sound": {
"type": "string",
"enum": [
"on",
"off"
],
"example": "on"
},
"video_list": {
"type": "array",
"items": {
"$ref": "#/definitions/httpapi.KelingOmniVideoInput"
}
},
"watermark_info": {
"$ref": "#/definitions/httpapi.KelingOmniWatermarkInfo"
}
}
},
"httpapi.KelingOmniWatermarkInfo": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"example": false
}
}
},
"httpapi.ModelCatalogFilterOption": {
"type": "object",
"properties": {
@@ -12242,6 +12588,14 @@
"httpapi.TaskRequest": {
"type": "object",
"properties": {
"aspect_ratio": {
"type": "string",
"example": "16:9"
},
"audio": {
"type": "boolean",
"example": false
},
"audioWeight": {
"type": "number",
"example": 0.65
@@ -12368,6 +12722,10 @@
"type": "number",
"example": 1
},
"watermark": {
"type": "boolean",
"example": false
},
"weirdnessConstraint": {
"type": "number",
"example": 0.35
+241
View File
@@ -393,6 +393,125 @@ definitions:
example: easyai-ai-gateway
type: string
type: object
httpapi.KelingCompatibleEnvelope:
properties:
code:
example: 0
type: integer
data: {}
message:
example: SUCCEED
type: string
request_id:
type: string
type: object
httpapi.KelingOmniElementInput:
properties:
element_id: {}
type: object
httpapi.KelingOmniImageInput:
properties:
image_url:
type: string
type:
enum:
- first_frame
- end_frame
type: string
type: object
httpapi.KelingOmniMultiPrompt:
properties:
duration:
example: "3"
type: string
index:
example: 1
type: integer
prompt:
example: A wide establishing shot
type: string
type: object
httpapi.KelingOmniVideoInput:
properties:
keep_original_sound:
enum:
- "yes"
- "no"
type: string
refer_type:
enum:
- base
- feature
type: string
video_url:
type: string
type: object
httpapi.KelingOmniVideoRequest:
properties:
aspect_ratio:
enum:
- "16:9"
- "9:16"
- "1:1"
example: "9:16"
type: string
callback_url:
type: string
duration:
example: "5"
type: string
element_list:
items:
$ref: '#/definitions/httpapi.KelingOmniElementInput'
type: array
external_task_id:
type: string
image_list:
items:
$ref: '#/definitions/httpapi.KelingOmniImageInput'
type: array
mode:
enum:
- std
- pro
- 4k
example: pro
type: string
model_name:
example: kling-v3-omni
type: string
multi_prompt:
items:
$ref: '#/definitions/httpapi.KelingOmniMultiPrompt'
type: array
multi_shot:
example: false
type: boolean
prompt:
example: A quiet street in the rain with natural ambient sound
type: string
shot_type:
example: customize
type: string
sound:
enum:
- "on"
- "off"
example: "on"
type: string
video_list:
items:
$ref: '#/definitions/httpapi.KelingOmniVideoInput'
type: array
watermark_info:
$ref: '#/definitions/httpapi.KelingOmniWatermarkInfo'
type: object
httpapi.KelingOmniWatermarkInfo:
properties:
enabled:
example: false
type: boolean
type: object
httpapi.ModelCatalogFilterOption:
properties:
count:
@@ -909,6 +1028,12 @@ definitions:
type: object
httpapi.TaskRequest:
properties:
aspect_ratio:
example: "16:9"
type: string
audio:
example: false
type: boolean
audioWeight:
example: 0.65
type: number
@@ -1005,6 +1130,9 @@ definitions:
vol:
example: 1
type: number
watermark:
example: false
type: boolean
weirdnessConstraint:
example: 0.35
type: number
@@ -6408,6 +6536,33 @@ paths:
summary: 批量写入 API Key 访问规则
tags:
- api-keys
/api/v1/api-keys/assignable-models:
get:
description: 按当前用户自身的用户、租户和用户组权限返回可分配给 API Key 的启用模型,不受任何 API Key 权限规则影响。
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/httpapi.PlatformModelListResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/httpapi.ErrorEnvelope'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/httpapi.ErrorEnvelope'
"503":
description: Service Unavailable
schema:
$ref: '#/definitions/httpapi.ErrorEnvelope'
security:
- BearerAuth: []
summary: 列出 API Key 可分配模型
tags:
- api-keys
/api/v1/auth/login:
post:
consumes:
@@ -9904,6 +10059,92 @@ paths:
summary: 取消异步任务
tags:
- tasks
/v1/videos/omni-video:
post:
consumes:
- application/json
description: 兼容 Kling 旧版 /v1/videos/omni-videoBearer token 必须为 Gateway API
Key。任务固定异步执行,返回的 task_id 为网关任务 ID。
parameters:
- description: Kling Omni 官方兼容请求
in: body
name: input
required: true
schema:
$ref: '#/definitions/httpapi.KelingOmniVideoRequest'
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"400":
description: Bad Request
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"403":
description: Forbidden
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"429":
description: Too Many Requests
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"503":
description: Service Unavailable
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
security:
- BearerAuth: []
summary: 创建 Kling Omni 视频任务
tags:
- kling-compatible
/v1/videos/omni-video/{taskID}:
get:
description: 按创建接口返回的网关 task_id 查询任务;仅允许创建任务的 Gateway 用户访问。
parameters:
- description: 网关任务 ID
in: path
name: taskID
required: true
type: string
produces:
- application/json
responses:
"200":
description: OK
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"403":
description: Forbidden
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"404":
description: Not Found
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/httpapi.KelingCompatibleEnvelope'
security:
- BearerAuth: []
summary: 查询 Kling Omni 视频任务
tags:
- kling-compatible
/v1/voice_clone:
post:
consumes: