轮询视频生成状态

GET/v1/videos/{video_id}

轮询由 POST /v1/videos 创建的视频生成任务。使用提交响应中的任务 id 查询生成是否仍在排队、生成中、已完成或已失败。

认证

Authorization Bearer

在 Authorization 请求头中使用 API Key 作为 Bearer Token。

路径参数

video_idstringrequired

视频任务 ID。

Response

idstring

视频任务 ID。

objectstring

对象类型,固定为 video。

statusstring

视频任务的当前状态。

modelstring

使用的模型。

promptstring

输入提示词。

created_atinteger

Unix 创建时间戳。

updated_atinteger

Unix 最后更新时间戳。

parametersobject

生成参数回显,例如 resolution、duration、aspect_ratio、seed、audio、watermark。

responseobject

可用时返回的原始响应详情。

urlstring

预签名视频 URL;当 status 为 completed 时返回。

video_urlstring

视频 URL(如可用)。

durationinteger

视频最终时长(秒);完成时返回。

contentobject

返回时包含的额外生成资产。

content.last_frame_urlstring

当 return_last_frame=true 且返回最后一帧时的图片 URL。

errorobject | null

错误详情;当 status 为 failed 时返回。

error.codestring

错误代码。

error.messagestring

错误信息。

usageobject

可用时返回的用量和计费详情。

usage.prompt_tokensinteger

Input token count when returned.

usage.completion_tokensinteger

Output token count when returned.

usage.total_tokensinteger

Total token count when returned.

usage.input_tokensinteger

Input token count for providers that use input/output names.

usage.output_tokensinteger

Output token count for providers that use input/output names.

usage.generated_imagesinteger

Generated image count when returned.

usage.audio_duration_secondsnumber

Audio duration used for billing when returned.

usage.video_duration_secondsnumber

Video duration used for billing when returned.

usage.provider_request_idstring

Provider request ID used for upstream correlation.

根据模型供应商的不同,可能包含供应商特定的额外字段(例如 resolutionfileformatframesgenerate_audioresponse.*)。

Polling Behavior

  • queued:任务已接收,等待开始。
  • in_progress:正在生成,继续轮询。
  • completed:结果已准备好,通过 urlvideo_url 获取生成视频。
  • failed:生成失败,查看 error.codeerror.message

请求

Shell
1curl https://api.token360.ai/v1/videos/your-video-id \
2  -H "Authorization: Bearer sk-your-api-key"

将提交响应中的 id 作为 video_id

响应

JSON
1{
2  "id": "your-video-id",
3  "object": "video",
4  "status": "completed",
5  "model": "your-video-model",
6  "prompt": "Add gentle motion to the scene",
7  "created_at": 1776352017,
8  "updated_at": 1776352105,
9  "duration": 4,
10  "resolution": "720p",
11  "progress": 100,
12  "parameters": {
13    "duration": 4,
14    "resolution": "720p",
15    "aspect_ratio": "16:9",
16    "video_mode": "i2v_first_frame"
17  },
18  "url": "your-video-url",
19  "video_url": "your-video-url"
20}
此页面对您有帮助吗?