读取视频
先调用「创建视频」,用返回的 ID 替换 video_123;下载前须轮询至 completed。
GET
/model/v1/videos/{video_id}● 支持请求参数
video_idstring必填path: Id of the video job whose output you want, the
idreturned by createVideo. The job must be completed; before that the call answers 400.
返回
200
按输出秒数计费;每秒价格见 GET /model/v1/models 的 pricing.video_second(USD/秒)。
鉴权、限流、参数校验等平台错误按 problem+json 返回;OCR 的错误也为 problem+json,其它模型调用的错误按该端点所属格式(OpenAI 或 Anthropic)返回,参见 错误码
请求示例
curl
# 先调用「创建视频」,用返回的 ID 替换 video_123;下载前须轮询至 completed。
curl https://api.deepraxis.com/model/v1/videos/video_123 \
-H "Authorization: Bearer $PRAXIS_API_KEY"Python
# 先调用「创建视频」,用返回的 ID 替换 video_123;下载前须轮询至 completed。
import requests
opts = dict(
base_url="https://api.deepraxis.com/model/v1",
api_key="$PRAXIS_API_KEY",
)
response = requests.request("GET", f"{opts['base_url']}/videos/video_123",
headers={"Authorization": f"Bearer {opts['api_key']}"}
)
response.raise_for_status()
print(response.json())TypeScript
// 先调用「创建视频」,用返回的 ID 替换 video_123;下载前须轮询至 completed。
const opts = {
baseURL: "https://api.deepraxis.com/model/v1",
apiKey: "$PRAXIS_API_KEY",
};
const response = await fetch(`${opts.baseURL}/videos/video_123`, {
method: "GET",
headers: { Authorization: `Bearer ${opts.apiKey}` },
});
if (!response.ok) throw new Error(await response.text());
console.log(await response.json());响应
HTTP 200
Success
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| id | string | Id of the video job; pass it as video_id to retrieve, download or delete it. |
| object | string | Object type; always video. |
| model | string | Model that generates the video. |
| status | string | Lifecycle of the job. Poll until it is completed or failed. |
| progress | integer | Progress from 0 to 100. It is 0 until the job completes and 100 once it has. |
| created_at | integer | Unix time in seconds at which the job was created. |
| completed_at | integer | null | Unix time in seconds at which the job completed; null until then. |
| expires_at | integer | null | Unix time in seconds after which the output expires; null because outputs currently have no expiry. |
| seconds | string | Length of the video in seconds, as a string; for a completed job it is the delivered length. |
| size | string | Resolution of the video as WIDTHxHEIGHT; null when the provider did not report one. |
| prompt | string | null | Prompt the job was created with. |
| remixed_from_video_id | null | Always null; remix is not supported. |
| error | object | null | Why the job failed; null unless status is failed. |
| error.code | string | Machine-readable failure code. |
| error.message | string | Human-readable failure message. |
| polling_url | string | Relative URL to poll for the job state; same as retrieveVideo for this job. |
| unsigned_urls | array<string> | Relative URLs of the finished output; empty until the video is ready. Download them with the same API key. |
| usage | object | Cost of the job; present once a price applies. |
| usage.cost | number | Cost of the job in USD: billed seconds times the per-second price once completed, 0 while running. Billed seconds are the delivered seconds, except for a job with input_videos (see billed_seconds). |
| usage.billed_seconds | integer | Only on a completed job with input_videos: the seconds it is billed for. The model meters input plus output seconds at a lower rate, converted here to seconds of the delivered resolution, so it can exceed seconds. |
先创建视频,保存返回的 id;再读取视频轮询 status,queued / in_progress 时继续等待,failed 时停止并查看 error;只有 completed 后才下载视频内容。