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

# 获取视频生成任务状态

> 查询视频生成任务的状态和结果。

任务状态：

* `queued`：排队中
* `in_progress`：生成中
* `completed`：已完成
* `failed`：失败

## 请求头

**Authorization** `string` *required*

使用 Bearer Token 认证。格式：`Authorization: Bearer sk-xxxxxx`

## 路径参数

**task\_id** `string` *required*

任务 ID

## 响应

### 200 成功获取任务状态

格式：`application/json`

**task\_id** `string`

任务 ID

**status** `string`

任务状态，可选值：`queued`、`in_progress`、`completed`、`failed`

**url** `string`

视频资源 URL（成功时）

**format** `string`

视频格式

**metadata** `object`

视频任务元数据

**属性**

**duration** `number`

实际生成的视频时长

**fps** `integer`

实际帧率

**width** `integer`

实际宽度

**height** `integer`

实际高度

**seed** `integer`

使用的随机种子

**error** `object`

视频任务错误信息

**属性**

**code** `integer`

错误码

**message** `string`

错误信息

### 404 任务不存在

格式：`application/json`

**error** `object`

错误信息

**属性**

**message** `string`

错误信息

**type** `string`

错误类型

**param** `string | null`

相关参数

**code** `string | null`

错误代码

```bash cURL theme={"dark"}
curl -X GET "https://t.ato2.nodesms.com/v1/video/generations/{task_id}" \
  -H "Authorization: Bearer $API_KEY"
```

```python Python theme={"dark"}
import requests

task_id = "your_task_id"
response = requests.get(
    f"https://t.ato2.nodesms.com/v1/video/generations/{task_id}",
    headers={"Authorization": "Bearer sk-xxxxx"},
)
print(response.json())
```

```json 200 theme={"dark"}
{
  "task_id": "string",
  "status": "queued",
  "url": "string",
  "format": "string",
  "metadata": {
    "duration": 0,
    "fps": 0,
    "width": 0,
    "height": 0,
    "seed": 0
  },
  "error": {
    "code": 0,
    "message": "string"
  }
}
```

```json 404 theme={"dark"}
{
  "error": {
    "message": "string",
    "type": "string",
    "param": null,
    "code": null
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.