> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magic666.top/llms.txt
> Use this file to discover all available pages before exploring further.

# 国产视频模型查询

> 使用 `GET /v1/videos/{task_id}` 查询国产视频任务状态、进度、错误和视频结果。

# 国产视频模型查询

提交任务后，使用任务 ID 轮询查询。国产视频模型查询接口会返回统一的视频任务状态、进度、错误信息和结果地址。

## 查询任务

```http theme={null}
GET /v1/videos/{task_id}
```

<CodeGroup>
  ```bash theme={null}
  curl -H "Authorization: Bearer $TOKEN" \
    "$BASE_URL/v1/videos/{task_id}"
  ```
</CodeGroup>

## 获取视频内容

```http theme={null}
GET /v1/videos/{task_id}/content
```

<CodeGroup>
  ```bash theme={null}
  curl -H "Authorization: Bearer $TOKEN" \
    "$BASE_URL/v1/videos/{task_id}/content"
  ```
</CodeGroup>

## 状态映射

| 任务阶段         | `status`               | 说明       |
| ------------ | ---------------------- | -------- |
| `WAITING`    | `queued`               | 任务排队中    |
| `PROCESSING` | `processing`           | 任务生成中    |
| `FINISH`     | `completed`            | 任务完成     |
| `ABORTED`    | `failed` / `cancelled` | 任务失败或被中止 |

响应中的 `progress` 表示任务进度；失败时可从 `error.code` 和 `error.message` 查看错误原因。任务完成后，`video_url` 会返回生成结果地址。

## 响应字段

<ResponseField name="id" type="string">
  任务 ID。通常与提交接口返回的 `task_id` 一致。
</ResponseField>

<ResponseField name="object" type="string">
  对象类型，固定为 `video`。
</ResponseField>

<ResponseField name="model" type="string">
  请求时使用的模型名称，可能是基础模型，也可能是组合计费模型。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态，常见值为 `queued`、`processing`、`completed`、`failed`、`cancelled`。
</ResponseField>

<ResponseField name="progress" type="integer">
  任务进度百分比。进度不可用时可能为空或为默认值。
</ResponseField>

<ResponseField name="created_at" type="integer">
  创建时间戳。
</ResponseField>

<ResponseField name="completed_at" type="integer">
  完成时间戳。任务未完成时可能为空。
</ResponseField>

<ResponseField name="expires_at" type="integer">
  结果过期时间戳。是否返回取决于任务配置和存储方式。
</ResponseField>

<ResponseField name="seconds" type="string">
  输出视频时长。
</ResponseField>

<ResponseField name="size" type="string">
  输出尺寸或分辨率描述。
</ResponseField>

<ResponseField name="video_url" type="string">
  生成完成后的视频地址。
</ResponseField>

<ResponseField name="metadata" type="object">
  附加信息。完成后通常会包含结果 URL 等便于前端或转存流程使用的信息。
</ResponseField>

<ResponseField name="error" type="object">
  错误信息。任务失败时通常会包含错误码和错误消息。
</ResponseField>

## 成功响应示例

```json theme={null}
{
  "id": "video_abc123",
  "object": "video",
  "model": "Kling-3.0-Omni",
  "status": "completed",
  "progress": 100,
  "created_at": 1760000000,
  "completed_at": 1760000060,
  "video_url": "https://example.com/output.mp4",
  "metadata": {
    "url": "https://example.com/output.mp4"
  }
}
```

## 失败响应示例

```json theme={null}
{
  "id": "video_abc123",
  "object": "video",
  "model": "Kling-3.0-Omni",
  "status": "failed",
  "error": {
    "code": "InvalidParameter",
    "message": "videoUrl must not be blank"
  }
}
```

## 排查建议

* 如果动作控制任务失败并提示 `videoUrl must not be blank`，确认 `metadata.video_url` 或 `metadata.file_infos` 中是否提供了 `Category=Video` 的视频参考。
* 如果任务完成但没有 `video_url`，确认任务结果文件地址是否已生成并可访问。
* 如果比例或分辨率不符合预期，生成时显式传 `metadata.output_config.resolution` 和 `metadata.output_config.aspect_ratio`。
* 如果对口型计费时长和请求时长不一致，检查是否命中 `scene_type=lip_sync` 不足 5 秒按 5 秒计的规则。

## 相关页面

* [国产视频模型概览](./overview)
* [国产视频模型生成](./generation)
