Skip to content

Download a video

Download a completed video, by redirect to a fresh signed link or as JSON with the link.

Markdown
On this page
GET/v1/videos/{id}/content

Returns the file of a completed job. By default the answer is a 302 redirect to a signed link in Lykia's storage, valid for one hour; a client that follows redirects downloads the file in one step. The signed link needs no API key. If Lykia's storage is not available, the file is streamed through this endpoint instead.

Query parameters

redirectstring

false to receive { url, expires_at, mime_type } as JSON instead of the redirect.

Example

# Follows the redirect to the signed file and saves it
curl -L https://api.getlykia.com/v1/videos/gen-1795463406-qOWSYdRnX7cEsv8q/content \
  -H "Authorization: Bearer $LYKIA_API_KEY" \
  -o beach.mp4

With ?redirect=false:

200 OK
{
    "url": "https://files.example.com/media/gen-1795463406-qOWSYdRnX7cEsv8q/0.mp4?X-Amz-Expires=3600&X-Amz-Signature=5f0c9e…",
    "expires_at": "2026-11-23T20:50:41.269Z",
    "mime_type": "video/mp4"
}

Headers: X-Generation-Id and X-Lykia-Cost (the job's cost).

Errors

StatusCodeWhen
404not_foundNo such job in this project.
409video_not_readyThe job is not completed (yet).
410video_expiredThe file was deleted after expires_at.
409 Conflict
{
    "error": {
        "message": "The video is queued; content is available once it is completed",
        "type": "invalid_request_error",
        "code": "video_not_ready",
        "status": 409,
        "metadata": {
            "reason": "invalid_request"
        }
    }
}