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

# Download video · Gemini API

> Download the video using the full video.uri returned by polling.

Replace `<VIDEO_URL>` with the returned `response.generateVideoResponse.generatedSamples[0].video.uri`:

```bash theme={"system"}
curl --fail -L -o video.mp4 "<VIDEO_URL>" \
  -H "Authorization: Bearer <AIOHUB_API_KEY>"
```

Use the full returned `uri`, including `:download?alt=media`. Do not construct a file name yourself. The Google GenAI SDK can download this URI through `files.download`.

`file` is the file name in the returned URL, not `task_id` or the entire URL. Use an API key belonging to the account that created the task. Files expire 72 hours after success and return 410 afterward.


## OpenAPI

````yaml openapi/relay.en.json GET /v1beta/files/{file}:download
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub public API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: List models
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: Image generation
  - name: OpenAI Images
  - name: Video generation
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: Text completions
  - name: OpenAI Audio
  - name: Realtime API
paths:
  /v1beta/files/{file}:download:
    get:
      tags:
        - Video generation
      summary: Download Gemini video
      description: >
        After a task succeeds, use the full returned video.uri. file is the file
        name from that URL, not task_id or the entire URL. Authentication is
        required; files remain for 72 hours after success.
      operationId: downloadSeedanceGeminiVideo
      parameters:
        - name: file
          in: path
          required: true
          description: File name between files/ and :download in the returned URI.
          schema:
            type: string
            example: 7461736b5f6578616d706c65
          example: 7461736b5f6578616d706c65
        - name: alt
          in: query
          required: true
          schema:
            type: string
            enum:
              - media
            default: media
          description: Use media to download the binary file.
        - name: Range
          in: header
          required: false
          schema:
            type: string
          description: Optional byte range, for example bytes=0-1023.
      responses:
        '200':
          description: MP4 video file.
          content:
            video/mp4:
              schema:
                type: string
                format: binary
        '206':
          description: Requested byte range.
          content:
            video/mp4:
              schema:
                type: string
                format: binary
        '400':
          description: Task is not complete.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceGoogleFileError'
        '401':
          description: Missing or invalid API key.
        '404':
          description: File not found or not owned by this account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceGoogleFileError'
        '410':
          description: Video retention has expired.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceGoogleFileError'
        '416':
          description: Requested byte range is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceGoogleFileError'
        '502':
          description: Video file is temporarily unavailable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SeedanceGoogleFileError'
      security:
        - BearerAuth: []
components:
  schemas:
    SeedanceGoogleFileError:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
              description: HTTP status code.
            message:
              type: string
              description: Error message.
            status:
              type: string
              description: Google-format error status.
          required:
            - code
            - message
            - status
      required:
        - error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk-xxx)

````

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