Skip to content

获取 Kling 文生视频任务状态

GET /kling/v1/videos/text2video/{task_id}

查询 Kling 文生视频任务的状态和结果。

基本信息

项目内容
Base URLhttps://www.yunzhuhub.cn
标签视频生成/Kling格式
Operation IDgetKlingText2Video

认证

  • BearerAuth:使用 Bearer Token 认证。 格式: Authorization: Bearer sk-xxxxxx

密钥安全

请只使用你自己的 API Key。示例中的 <YOUR_API_KEY> 必须在本地替换,不要把真实密钥提交到代码仓库或发送给他人。

参数

名称位置类型必填说明
task_idpathstring任务 ID

请求体

此接口没有请求体。

请求示例

以下示例只用于复制到本地终端,不会从文档站发送请求。

bash
curl --request GET 'https://www.yunzhuhub.cn/kling/v1/videos/text2video/{task_id}' \
  --header 'Authorization: Bearer <YOUR_API_KEY>'

响应

200 成功获取任务状态

json
{
  "title": "VideoTaskResponse",
  "type": "object",
  "description": "视频任务状态查询响应",
  "properties": {
    "task_id": {
      "type": "string",
      "description": "任务 ID",
      "example": "abcd1234efgh"
    },
    "status": {
      "type": "string",
      "description": "任务状态",
      "enum": [
        "queued",
        "in_progress",
        "completed",
        "failed"
      ],
      "example": "completed"
    },
    "url": {
      "type": "string",
      "description": "视频资源 URL(成功时)",
      "example": "https://example.com/video.mp4"
    },
    "format": {
      "type": "string",
      "description": "视频格式",
      "example": "mp4"
    },
    "metadata": {
      "$ref": "#/components/schemas/VideoTaskMetadata"
    },
    "error": {
      "$ref": "#/components/schemas/VideoTaskError"
    }
  }
}

404 任务不存在

json
{
  "title": "ErrorResponse",
  "type": "object",
  "properties": {
    "error": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "错误信息"
        },
        "type": {
          "type": "string",
          "description": "错误类型"
        },
        "param": {
          "type": "string",
          "description": "相关参数",
          "nullable": true
        },
        "code": {
          "type": "string",
          "description": "错误代码",
          "nullable": true
        }
      }
    }
  }
}

云筑Hub 文档。底层项目基于 New API