Jobs & Rendering
All rendering operations in Vidiking are asynchronous. When you submit a render request, you receive a job ID immediately. The actual rendering happens in the background.
Job Lifecycle
QUEUED → PROCESSING → COMPLETE
↘ FAILED
| Status | Description |
|---|---|
QUEUED | Job is waiting to be picked up by a render worker. |
PROCESSING | Job is actively being rendered. |
COMPLETE | Rendering finished successfully. Output URL is available. |
FAILED | Rendering failed. Error details are available. Funds are refunded. |
Submitting a Job
curl
curl -X POST https://api.vidiking.com/v1/render \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timeline": { ... },
"output": { "format": "mp4", "resolution": "hd" }
}'
Response:
{
"id": "job_abc123",
"status": "QUEUED",
"created_at": "2025-01-15T10:30:00Z"
}
Polling for Status
Poll the status endpoint until the job reaches COMPLETE or FAILED.
curl
curl https://api.vidiking.com/v1/render/job_abc123 \
-H "Authorization: Bearer $VIDIKING_API_KEY"
Node.js
// Simple polling
const poll = async (jobId, interval = 3000) => {
while (true) {
const job = await client.getRender(jobId);
if (job.status === 'COMPLETE') return job;
if (job.status === 'FAILED') throw new Error(job.error);
await new Promise(r => setTimeout(r, interval));
}
};
const job = await poll(jobId);
console.log('Output:', job.url);
Python
import time
def poll(job_id, interval=3):
while True:
job = client.get_render(job_id)
if job.status == "COMPLETE":
return job
if job.status == "FAILED":
raise Exception(job.error)
time.sleep(interval)
job = poll(result.job_id)
print("Output:", job.url)
Using Webhooks Instead
Polling works but wastes requests. Use webhooks to get notified when a job completes.
curl -X POST https://api.vidiking.com/v1/render \
-H "Authorization: Bearer $VIDIKING_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"timeline": { ... },
"output": { "format": "mp4", "resolution": "hd" },
"callback": "https://your-server.com/webhooks/vidiking"
}'
Job Details
A completed job includes the following fields:
{
"id": "job_abc123",
"status": "COMPLETE",
"url": "https://cdn.vidiking.com/renders/job_abc123.mp4",
"duration": 10.5,
"resolution": "1920x1080",
"format": "mp4",
"file_size": 8542100,
"credits_used": 10,
"created_at": "2025-01-15T10:30:00Z",
"processing_started_at": "2025-01-15T10:30:02Z",
"completed_at": "2025-01-15T10:30:45Z",
"render_time": 43
}
Failed Jobs
When a job fails, the response includes an error message and error code.
{
"id": "job_abc123",
"status": "FAILED",
"error": {
"code": "INVALID_ASSET",
"message": "Unable to fetch asset: https://example.com/missing.mp4 returned 404"
},
"credits_used": 0,
"created_at": "2025-01-15T10:30:00Z",
"failed_at": "2025-01-15T10:30:15Z"
}
Common error codes:
| Code | Description |
|---|---|
INVALID_ASSET | An asset URL returned an error or is unreachable |
INVALID_TIMELINE | Timeline JSON is malformed or has invalid properties |
INSUFFICIENT_CREDITS | Not enough balance in wallet |
RENDER_TIMEOUT | Rendering exceeded the maximum time limit (10 minutes) |
INTERNAL_ERROR | Unexpected server error. Contact support if persistent. |
Listing Jobs
curl
curl "https://api.vidiking.com/v1/render?limit=20&status=COMPLETE" \
-H "Authorization: Bearer $VIDIKING_API_KEY"
Node.js
const jobs = await client.listRenders({ limit: 20, status: 'COMPLETE' });
Python
jobs = client.list_renders(limit=20, status="COMPLETE")