1. kling
梧柏API使用文档
WHBAI · Kling
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • 可灵 Kling
    • 文生音效
    • 文生视频
    • 图生视频
    • 文生图
    • 查询文生视频任务
    • Omni-Video
  • kling
    • 对口型
      POST
    • 虚拟试穿
      POST
    • 视频延长
      POST
    • 视频特效
      POST
    • 多图参考生视频
      POST
    • 查询任务(免费)
      GET
    • 查询任务(单个)
      GET
    • Omni-Image
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 初始化待编辑视频
      POST
    • 增加视频选区
      POST
    • 删减视频选区
      POST
    • 预览已选区视频
      POST
    • 多模态视频
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 多图参考生图
      POST
    • 查询任务(单个)
      GET
    • 文生视频
      POST
    • 图生视频
      POST
    • 查询视频
      GET
    • 查询任务(单个)
      GET
    • 扩图
      POST
    • 查询任务(单个)
      GET
    • 图像识别
      POST
    • 数字人
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 视频生音效
      POST
    • 查询任务(单个)
      GET
    • 语音合成
      POST
    • 查询任务(单个)
      GET
    • 人脸识别
      POST
    • 对口型
      POST
    • 查询任务(单个)
      GET
    • 自定义音色
      POST
    • 查询自定义音色(单个)
      GET
    • 查询官方音色
      GET
    • 删除自定义音色
      POST
    • 动作控制
      POST
    • 查询任务(单个)
      GET
    • 主体(旧)
      POST
    • 主体(新版本)
      POST
    • 查询自定义主体(单个新版本)
      GET
    • 查询官方主体(列表新版本)
      GET
    • 删除自定义主体(新版本)
      POST
  • 数据模型
    • KlingTaskSubmitResponse
    • KlingTaskQueryResponse
    • KlingText2VideoRequest
    • KlingImage2VideoRequest
    • PostKlingV1ImagesGenerationsRequest
    • KlingOmniVideoRequest
    • NewApiError
  1. kling

文生视频

POST
/kling/text-to-video/kling-3.0-turbo

网站中的模型与调用示例#

文生视频#

请求参数#

{
  "contentType": "application/json",
  "properties": {
    "contents": {
      "description": "【替代】提示词数组写法,与顶层 prompt 二选一。每项 type 必须为 \"prompt\"(文生不支持 first_frame)。网关会提取 contents[].text 转为顶层 prompt 后转发上游。",
      "items": {
        "additionalProperties": false,
        "properties": {
          "text": {
            "description": "提示词文本,最多 3072 字符。",
            "maxLength": 3072,
            "minLength": 1,
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "Prompt text, max 3072 characters."
              }
            }
          },
          "type": {
            "const": "prompt",
            "description": "文生视频固定为 \"prompt\",传入 \"first_frame\" 会报 400。",
            "type": "string",
            "x-i18n": {
              "en-US": {
                "description": "text-to-video type must be \"prompt\"; \"first_frame\" returns 400."
              }
            }
          }
        },
        "required": [
          "type",
          "text"
        ],
        "type": "object"
      },
      "minItems": 1,
      "type": "array",
      "x-i18n": {
        "en-US": {
          "description": "[Alternative] Prompt array form, mutually exclusive with top-level prompt. Each item type must be \"prompt\" (text-to-video does not support first_frame). Gateway extracts contents[].text into top-level prompt then forwards upstream."
        }
      }
    },
    "options": {
      "additionalProperties": false,
      "description": "任务控制参数,全部可选。",
      "properties": {
        "callback_url": {
          "description": "任务完成后上游回调的 URL(需公网可访问)。",
          "format": "uri",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "Upstream callback URL after task completion (must be publicly accessible)."
            }
          }
        },
        "external_task_id": {
          "description": "业务侧自定义任务 ID,便于幂等查询和对账。",
          "type": "string",
          "x-i18n": {
            "en-US": {
              "description": "Caller-defined external task ID for idempotent queries and reconciliation."
            }
          }
        },
        "watermark_info": {
          "description": "水印配置,结构由上游定义,原样透传。",
          "properties": {},
          "type": "object",
          "x-i18n": {
            "en-US": {
              "description": "Watermark config defined by upstream, passed through as-is."
            }
          }
        }
      },
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Task control parameters, all optional."
        }
      }
    },
    "prompt": {
      "description": "【推荐】顶层提示词。最多 3072 字符。全角标点(,;:)由网关自动转为半角。与 contents[] 二选一,同时传入时 contents[] 被忽略。",
      "maxLength": 3072,
      "minLength": 1,
      "type": "string",
      "x-i18n": {
        "en-US": {
          "description": "[Recommended] top-level prompt. max 3072 characters. full-width punctuation(, ; : )auto-converted to half-width by the gateway. Mutually exclusive with contents[]; if both are set, contents[] is ignored."
        }
      }
    },
    "settings": {
      "additionalProperties": false,
      "description": "生成参数,全部可选。缺失时网关自动补默认值:resolution=720p, aspect_ratio=16:9, duration=5。",
      "properties": {
        "aspect_ratio": {
          "default": "16:9",
          "description": "画面宽高比,默认 16:9。",
          "enum": [
            "16:9",
            "9:16",
            "1:1"
          ],
          "type": "string",
          "x-apifox-enum": [
            {
              "description": "默认值,适合横屏/桌面端",
              "name": "横屏 16:9",
              "value": "16:9"
            },
            {
              "description": "适合短视频/手机竖屏",
              "name": "竖屏 9:16",
              "value": "9:16"
            },
            {
              "description": "适合社交媒体方形封面",
              "name": "方形 1:1",
              "value": "1:1"
            }
          ],
          "x-i18n": {
            "en-US": {
              "description": "Aspect ratio, default 16:9."
            }
          }
        },
        "duration": {
          "default": 5,
          "description": "视频时长(秒),范围 3–15,默认 5。计费金额与时长线性正相关。",
          "maximum": 15,
          "minimum": 3,
          "type": "integer",
          "x-i18n": {
            "en-US": {
              "description": "Video duration (seconds), range 3–15, default 5. Billing scales linearly with duration."
            }
          }
        },
        "resolution": {
          "default": "720p",
          "description": "输出分辨率,默认 720p。1080p 计费约 1.25×。",
          "enum": [
            "720p",
            "1080p"
          ],
          "type": "string",
          "x-apifox-enum": [
            {
              "description": "默认值;基准计费倍率",
              "name": "标清 720p",
              "value": "720p"
            },
            {
              "description": "计费倍率约 1.5×,画质更高",
              "name": "高清 1080p",
              "value": "1080p"
            }
          ],
          "x-i18n": {
            "en-US": {
              "description": "Output resolution, default 720p. 1080p bills ~1.25×."
            }
          }
        }
      },
      "type": "object",
      "x-i18n": {
        "en-US": {
          "description": "Generation params, all optional. Gateway defaults when missing: resolution=720p, aspect_ratio=16:9, duration=5."
        }
      }
    }
  },
  "required": []
}

请求示例 · 新手推荐:文生视频 · 最简请求#

{
  "contents": [
    {
      "text": "A cat running",
      "type": "prompt"
    }
  ],
  "settings": {
    "duration": 5,
    "resolution": "720p"
  }
}

请求示例 · 新手推荐:文生视频 · 竖屏短视频#

{
  "prompt": "Young woman walking through neon-lit Tokyo street at night, slow motion",
  "settings": {
    "aspect_ratio": "9:16",
    "duration": 5,
    "resolution": "720p"
  }
}

请求示例 · 新手推荐:文生视频 · 方形画面#

{
  "prompt": "Coffee being poured into a glass cup, macro shot, warm tones",
  "settings": {
    "aspect_ratio": "1:1",
    "duration": 5,
    "resolution": "720p"
  }
}

请求示例 · 进阶推荐:文生视频 · 1080p 高清长视频#

{
  "prompt": "Epic aerial view of Zhangjiajie mountains emerging from clouds, golden hour, cinematic drone footage",
  "settings": {
    "aspect_ratio": "16:9",
    "duration": 10,
    "resolution": "1080p"
  }
}

请求示例 · 进阶推荐:文生视频 · 1080p 竖屏最长视频#

{
  "prompt": "Fashion model walking on runway, dynamic lighting, high fashion editorial style",
  "settings": {
    "aspect_ratio": "9:16",
    "duration": 15,
    "resolution": "1080p"
  }
}

请求示例 · 进阶推荐:文生视频 · contents 数组写法 + 回调#

{
  "contents": [
    {
      "text": "Autumn leaves falling in a Japanese garden, koi pond reflections, peaceful atmosphere",
      "type": "prompt"
    }
  ],
  "options": {
    "callback_url": "https://your-server.com/webhook/kling",
    "external_task_id": "biz-order-20240623-001"
  },
  "settings": {
    "aspect_ratio": "16:9",
    "duration": 8,
    "resolution": "720p"
  }
}

请求示例 · 进阶推荐:文生视频 · 多镜头故事板(Multi-Shot Storyboard)#

{
  "prompt": "Shot 1,2,a young woman stands at window looking outside, morning light filters in;Shot 2,3,she turns around with a smile, coffee cup in hand;Shot 3,5,she walks to the balcony, city skyline in background, golden hour;",
  "settings": {
    "aspect_ratio": "16:9",
    "duration": 10,
    "resolution": "1080p"
  }
}

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Header 参数

Body 参数application/json必填

示例
{
    "contents": [
        {
            "type": "prompt",
            "text": "A cat running"
        }
    ],
    "settings": {
        "resolution": "720p",
        "duration": 5
    }
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/kling/text-to-video/kling-3.0-turbo' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        {
            "type": "prompt",
            "text": "A cat running"
        }
    ],
    "settings": {
        "resolution": "720p",
        "duration": 5
    }
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "code": 0,
    "message": "string",
    "data": {
        "id": "string",
        "task_id": "string",
        "status": "string",
        "task_status": "string"
    }
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:09
上一页
查询任务(单个)
下一页
图生视频
Built with