# AI视频切片 - 任务查询 API Documentation

> 切片任务查询；智能识别精准切片，自动生成高光短视频 ；

## Overview

This document describes how to call the **AI视频切片 - 任务查询** API.

- **Model / path slug**: `video/clip_taskquery`
- **Task type**: `sync` (`sync` = synchronous, `async` = create task then poll / callback)
- **HTML docs**: `/doc/8`

## Authentication

All API requests require your platform API key as the query parameter `key`:

```
?key=YOUR_API_KEY
```

Get API Key:
1. Sign in to the console
2. Open [API Key Management](/user/key) and create or copy your key
3. Append `key=YOUR_API_KEY` to the request URL (or pass it in form/JSON when the endpoint accepts it)

---

## API Information

- **URL**: `GET https://apis.xiaobao.ink/api/video/clip_taskquery`
- **Content-Type**: `application/json` (request body commonly `application/json` or `application/x-www-form-urlencoded` for POST)
- **HTTP Method**: `GET`

### Request Parameters

| Parameter | Required | Description |
|-----------|----------|-------------|
| `task_id` | Yes | 任务ID，用于查询任务结果 |

> **Note**: `key` (API key) is required for authenticated calls even if omitted from the parameter list above.

### Request Example

```
https://apis.xiaobao.ink/api/video/clip_taskquery?key=你的密钥
```

## Details

##
请求参数说明：

| 名称 | 必填 | 类型 | 示例值 | 说明 |
| --- | --- | --- | --- | --- |
| task_id | 是 | string | XSSS | 任务ID，用于查询任务结果 |

## 返回参数说明：

| 名称 | 类型 | 说明 |
| --- | --- | --- |
| state | int | 任务状态码   -11 未识别到有效语音内容 -8 处理超时（语音识别 最长处理10分钟；媒体服务 最长处理600秒） -7 无效文件（比如文件损坏、格式不对等） -5 超出大小（请参阅每个服务的大小限制） -4 提交失败 -3 下载失败（检查文件URL是否可用） -2 上传失败 -1 失败 0 队列中 1 完成 2 准备中 3 等待中 4 处理中 5 发布中 |
| task_id | string | 任务id |
| created_at | int | 创建时间（时间戳） |
| processed_at | int | 处理时间（时间戳） |
| completed_at | int | 完成时间（时间戳） |
| progress | int | 进度，范围0-100 |
| result | array | 文件识别出来的内容，数组中的每个元素包含start(片段开始时间，单位：毫秒)、end(片段结束时间，单位：毫秒)和text(识别出的文本内容)字段 |
| -   start  |  int | 片段开始时间，单位：毫秒 |
| -   end | int | 片段结束时间，单位：毫秒 |
| -   duration | int | 切片时长, 单位: 毫秒 |
| -   file_url | string | 切片文件对应的URL，可下载对应切片视频 |
| -   theme | string | 切片主题 |
| -   summary | string | 切片概要 |

## Response Example

```json
{
    "code": 200,
    "data": {
        "completed_at": 1751822613,
        "created_at": 1751822548,
        "processed_at": 1751822547,
        "progress": 100,
        "result": [
            {
                "duration": 44100,
                "end": 33993,
                "file_url": "https://xxx",
                "start": 1170,
                "summary": "这是关于主题1的总结内容",
                "theme": "主题1..."
            },
            {
                "duration": 50500,
                "end": 40367,
                "file_url": "https://xxx",
                "start": 10000,
                "summary": "这是关于主题2的总结内容",
                "theme": "主题2..."
            }
        ],
        "state": 1,
        "state_detail": "Complete",
        "task_id": "50c80a82-a923-491e-bad6-b7e331035f9c"
    }
}
```

## Error Codes

| HTTP 响应状态码 | 说明 |
| --- | --- |
| 200 | 请求成功 |
| 400 | 客户端参数传递错误，请检查参数是否缺失或值是否正确 |
| 401 | 认证失败。 请检查X-API-KEY是否正确或者服务是否开通 |
| 404 | 请求的URL或资源不存在。 请检查URL 或 URL中的 task id 是否正确 |
| 413 | 上传的文件超出大小限制。请检查文件大小，参见各个服务的最大文件限制 |
| 429 | 请求频率超出QPS限制。请放缓请求速率，或者联系商务提升QPS限制 |
| 500 | 服务端异常。请反馈给商务或技术对接人员 |

## Usage Flow

1. Obtain your API Key from the console
2. Call the endpoint with `key` and required parameters
3. Parse the JSON (or binary) response according to the examples above

---

_Generated for AI / LLM consumption. Source of truth: `api_list` (same as HTML `/doc/{id}`)._
