Get Video Task Status
Query a video-generation task's status and result — fetch real-time state by task_id, get the video URL once completed
Query a task's status using the task_id returned by Create Video Task. Once the task reaches completed, the response contains the video URL (or you can stream the bytes via /v1/videos/{task_id}/content).
| Field | Value |
|---|---|
| Method | GET |
| Path | /v1/video/generations/{task_id} |
| Full URL | https://api.amux.ai/v1/video/generations/{task_id} |
| Auth | Authorization: Bearer <API_TOKEN> |
| Body | none |
| Response format | application/json |
OpenAI Sora-compatible alias: amux-api also serves GET /v1/videos/{task_id} with identical behavior.
Path Parameters
Prop
Type
Response Fields
Prop
Type
status Enum
Prop
Type
Metadata Fields
Prop
Type
Error Fields
Prop
Type
Response Examples
Queued
{
"task_id": "abcd1234efgh",
"status": "queued"
}In Progress
{
"task_id": "abcd1234efgh",
"status": "in_progress"
}Completed
{
"task_id": "abcd1234efgh",
"status": "completed",
"url": "https://upstream.cdn.example.com/.../result.mp4",
"format": "mp4",
"metadata": {
"duration": 5.0,
"fps": 24,
"width": 1280,
"height": 720,
"seed": 20231234
}
}Failed
{
"task_id": "abcd1234efgh",
"status": "failed",
"error": {
"code": 50001,
"message": "Upstream model rejected the prompt due to content policy."
}
}Examples
curl "https://api.amux.ai/v1/video/generations/abcd1234efgh" \
-H "Authorization: Bearer $AMUX_API_KEY"import os
import time
import httpx
API_KEY = os.environ["AMUX_API_KEY"]
TASK_ID = "abcd1234efgh"
while True:
response = httpx.get(
f"https://api.amux.ai/v1/video/generations/{TASK_ID}",
headers={"Authorization": f"Bearer {API_KEY}"},
)
task = response.json()
status = task["status"]
print(f"Status: {status}")
if status == "completed":
print(f"Video URL: {task['url']}")
break
if status == "failed":
print(f"Error: {task['error']}")
break
time.sleep(5)const API_KEY = process.env.AMUX_API_KEY!;
const TASK_ID = 'abcd1234efgh';
while (true) {
const response = await fetch(
`https://api.amux.ai/v1/video/generations/${TASK_ID}`,
{ headers: { Authorization: `Bearer ${API_KEY}` } },
);
const task = await response.json();
console.log(`Status: ${task.status}`);
if (task.status === 'completed') {
console.log(`Video URL: ${task.url}`);
break;
}
if (task.status === 'failed') {
console.log('Error:', task.error);
break;
}
await new Promise((r) => setTimeout(r, 5000));
}Polling Recommendations
Video generation typically takes tens of seconds to several minutes. We recommend:
| Item | Suggested Value |
|---|---|
| First-poll delay | 5–10 seconds |
| Polling interval | 5–10 seconds |
| Total timeout | 5–10 minutes (model-dependent) |
| Exponential backoff | For long-running tasks, gradually increase the interval |
Downloading Video Content
When status=completed, in addition to using the response url, amux-api also exposes a video proxy endpoint:
GET /v1/videos/{task_id}/contentThis streams the video bytes as application/octet-stream (or the appropriate MIME type), useful when:
- The upstream URL has expired or uses temporary signing
- You don't want to expose the upstream domain to clients
- Servers can reach amux but not the upstream
curl "https://api.amux.ai/v1/videos/abcd1234efgh/content" \
-H "Authorization: Bearer $AMUX_API_KEY" \
-o video.mp4Error Response
{
"error": {
"message": "...",
"type": "invalid_request_error",
"code": "task_not_found"
}
}| HTTP Status | Meaning |
|---|---|
200 | Query succeeded (note: status=failed is also 200 — error details live in the response body's error field) |
401 | Missing or invalid API key |
403 | The task_id does not belong to your account |
404 | task_id not found or expired |
500 | Server-side error |