> ## Documentation Index
> Fetch the complete documentation index at: https://docs.olimi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Download a video

> Returns a temporary download link for a finished video.

Returns a temporary link to the MP4, valid for up to one hour. Download the file from `downloadUrl` and store it yourself if you need it longer; call this again for a working link.

It only works once the video is `completed`. Before that, you get `400` `Video is not generated or ready for download`.


## OpenAPI

````yaml get /api/v2/stv/{id}/download
openapi: 3.0.1
info:
  title: Customer Management API
  description: API for managing customer lists and customers within those lists
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-eg.olimi.ai
security:
  - bearerAuth: []
paths:
  /api/v2/stv/{id}/download:
    get:
      tags:
        - Speech to Video
      summary: Download a video
      description: Returns a temporary download link for a finished video.
      parameters:
        - name: id
          in: path
          required: true
          description: The video's `id`.
          schema:
            type: string
            format: uuid
          example: 7a3e9c12-5d8b-4f61-a2c7-9e0b3d6f1a48
      responses:
        '200':
          description: A download link.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StvDownloadResponse'
        '400':
          description: >-
            `Video is not generated or ready for download`: the video isn't
            `completed` yet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NestBadRequest'
        '401':
          description: The `X-API-KEY` header is missing or the key isn't valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: >-
            `stv_job_not_found`: no video with that `id` belongs to your
            company, or it was deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorStv'
      security:
        - apiKeyAuth: []
components:
  schemas:
    StvDownloadResponse:
      type: object
      properties:
        message:
          type: string
          example: Download URL generated successfully
        data:
          type: object
          properties:
            downloadUrl:
              type: string
              description: A temporary download link for the MP4, valid for up to one hour.
              example: >-
                https://<storage-host>/stv/video_e6d2a8f1?X-Amz-Expires=3600&X-Amz-Signature=…
    NestBadRequest:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          type: string
          example: No audio files provided
        error:
          type: string
          example: Bad Request
    ApiError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 404
        errorCode:
          type: string
          description: Machine-readable error code.
          example: agent_not_found
        message:
          type: string
          description: Human-readable text. May change; don't match on it.
          example: Agent not found
    ApiErrorStv:
      type: object
      properties:
        statusCode:
          type: integer
          example: 404
        errorCode:
          type: string
          example: stv_job_not_found
        message:
          type: string
          example: Speech-to-video job not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.