Skip to main content

Download Generated Video Content

GET 

https://api.knox.chat/v1/videos/:jobId/content

Download the generated video for a job created by POST /v1/videos. The job must already be completed — poll GET /v1/videos/{jobId} first.

The response is raw media (typically video/mp4), not JSON. When the file is stored in object storage, the API may respond with 307 Temporary Redirect to a short-lived presigned URL. Follow redirects (curl -L) and treat unsigned_urls from the poll response as an equivalent download path.

Request

Path Parameters

NameTypeRequiredDescription
jobIdStringYesJob ID returned by submit, for example job-3c91a0e8b7d24f11.

Query Parameters

NameTypeRequiredDescription
indexIntegerNoZero-based video index when a job produced multiple files. Defaults to 0.

Request Headers

NameTypeRequiredDescription
AuthorizationStringYesBearer authentication in the form Bearer <token>.

This endpoint has no request body.

cURL Example

Save the first (or only) video to a file. -L follows the optional 307 redirect:

curl -L "https://api.knox.chat/v1/videos/job-3c91a0e8b7d24f11/content" \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-o generated.mp4

Download a specific index:

curl -L "https://api.knox.chat/v1/videos/job-3c91a0e8b7d24f11/content?index=0" \
-H "Authorization: Bearer $KNOXCHAT_API_KEY" \
-o generated-0.mp4

Response

Success Response (200)

Raw video bytes. Typical headers:

HeaderValue
Content-Typevideo/mp4 (or the upstream media type, such as video/webm)
Cache-Controlprivate, max-age=60

There is no JSON body on success.

Redirect Response (307)

When the video is already stored, the API may return 307 Temporary Redirect with a Location header pointing at a presigned download URL. The redirect is also marked Cache-Control: private, max-age=60. HTTP clients should follow it automatically.

Error Responses

Content errors use the standard video error envelope:

{
"error": {
"code": 400,
"message": "Video content is not available until generation has completed"
}
}
StatusMessageWhen
400Video content is not available until generation has completedThe job is still pending or in_progress, or ended in a non-completed status.
401Missing Authentication headerMissing or invalid API key.
404Resource not foundUnknown jobId, another user's job, or no stored/upstream file for the requested index.
500Internal Server ErrorUnexpected server error.