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

# Download video content

> Stream the finished video's bytes for a job the provider reports completed, for the account that created it. The query string is forwarded, so a variant rides on the URL. This platform stores no video: the provider's own download window applies. A model whose provider serves no download through this door answers 400.



## OpenAPI

````yaml /api-reference/openapi.public.json get /v1/videos/{id}/content
openapi: 3.0.3
info:
  title: Hopscotch
  version: v1
  description: >-
    An OpenAI-compatible inference API. Point an OpenAI client at
    https://api.hopscotchlabs.ai, give it a Hopscotch API key, and call models
    across providers on one prepaid balance.


    Every response, errors included, matches the shape an unmodified OpenAI SDK
    expects.
servers:
  - url: https://api.hopscotchlabs.ai
    description: Production
security:
  - customerApiKey: []
tags:
  - name: Chat
    description: Chat completions, streamed or not.
  - name: Models
    description: What you can call.
  - name: Completions
    description: Text completions, streamed or not.
  - name: Messages
    description: The Anthropic Messages API, streamed or not.
  - name: Usage
    description: What one request recorded and what it cost.
  - name: Videos
    description: 'Video jobs: create, poll, download, delete.'
paths:
  /v1/videos/{id}/content:
    get:
      tags:
        - Videos
      summary: Download video content
      description: >-
        Stream the finished video's bytes for a job the provider reports
        completed, for the account that created it. The query string is
        forwarded, so a variant rides on the URL. This platform stores no video:
        the provider's own download window applies. A model whose provider
        serves no download through this door answers 400.
      operationId: downloadVideo
      parameters:
        - name: id
          in: path
          required: true
          description: The video job id the create answered.
          schema:
            type: string
          example: video_123
        - name: variant
          in: query
          required: false
          description: Forwarded to the provider unchanged.
          schema:
            type: string
          example: thumbnail
      responses:
        '200':
          description: >-
            The video (or the requested variant) bytes, streamed from the
            provider.
          headers:
            x-hopscotch-request-id:
              $ref: '#/components/headers/RequestId'
        '400':
          description: >-
            The provider serves no download for this job through this door. Its
            answer is relayed with its own status and sentence.
          headers:
            x-hopscotch-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Wan content downloads and cancellation are unsupported.
                  type: invalid_request_error
                  param: video_id
                  code: invalid_value
                  request_id: REQUEST_ID
        '401':
          description: >-
            No key, a scheme other than Bearer, a key of the wrong shape, or a
            key we reject. An unknown key and a revoked key are answered with
            one identical message on purpose.


            A key past its own expiry date is refused here too, with code
            `key_expired` and a message naming the date. It is checked before
            the per-minute rate limiter, so an expired key never consumes that
            allowance. Expired keys are not renewed: create a new one.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: Incorrect API key provided.
                  type: authentication_error
                  param: null
                  code: invalid_api_key
                  request_id: REQUEST_ID
          headers:
            x-hopscotch-request-id:
              $ref: '#/components/headers/RequestId'
        '404':
          description: >-
            No video with this id is visible to this key: a video another
            account made and an id that never existed answer identically, and
            the provider is not called.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    No video "video_123" is visible to this key. A video made by
                    another account and an id that never existed answer
                    identically.
                  type: invalid_request_error
                  param: video_id
                  code: video_not_found
                  request_id: REQUEST_ID
          headers:
            x-hopscotch-request-id:
              $ref: '#/components/headers/RequestId'
        '409':
          description: >-
            The provider does not report the job completed, so there are no
            bytes to serve.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  message: >-
                    Video "video_123" has no content: the provider reports it
                    in_progress, and content is served only for a completed
                    video.
                  type: invalid_request_error
                  param: video_id
                  code: video_not_completed
                  request_id: REQUEST_ID
          headers:
            x-hopscotch-request-id:
              $ref: '#/components/headers/RequestId'
        '429':
          description: >-
            A limit refused the request. `rate_limit_exceeded` is this key's own
            request rate and carries `Retry-After`. `spend_rate_exceeded` is the
            account spend rate cap, which counts the credit held for requests
            rather than the credit they settle at, and carries `Retry-After`.
            `upstream_rate_limited` is the model's provider rate-limiting the
            call: nothing about the request is wrong, nothing is charged, and it
            carries `Retry-After`.
          headers:
            Retry-After:
              schema:
                type: integer
                minimum: 1
              description: >-
                Seconds to wait. Present on `rate_limit_exceeded`,
                `spend_rate_exceeded` and `upstream_rate_limited`.
              example: 17
            x-hopscotch-request-id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                rate_limit_exceeded:
                  summary: This key's request rate
                  value:
                    error:
                      message: >-
                        Rate limit reached for this key. Try again in 12
                        seconds. Request id REQUEST_ID.
                      type: rate_limit_error
                      param: null
                      code: rate_limit_exceeded
                      request_id: REQUEST_ID
                spend_rate_exceeded:
                  summary: The account spend rate cap
                  value:
                    error:
                      message: >-
                        This account has already reserved 5000 minor units in
                        the last 60 seconds, which is at its ceiling of 5000.
                        Requests are admitted again within 60 seconds of the
                        earliest reservation counted, with nothing to do in the
                        meantime.
                      type: rate_limit_error
                      param: null
                      code: spend_rate_exceeded
                      request_id: REQUEST_ID
                upstream_rate_limited:
                  summary: The model's provider rate-limited the call
                  value:
                    error:
                      message: >-
                        The provider serving this model is rate-limiting
                        requests right now. Nothing was charged. Retry after the
                        number of seconds in the Retry-After header. Quote the
                        request id if you contact support.
                      type: rate_limit_error
                      param: null
                      code: upstream_rate_limited
                      request_id: REQUEST_ID
        '502':
          description: >-
            The provider holding the job could not be reached
            (`provider_unavailable`), or the answer it gave could not be read
            (`invalid_provider_response`). Nothing was charged.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                provider_unavailable:
                  summary: The provider could not be reached
                  value:
                    error:
                      message: >-
                        The provider that holds this video could not be reached.
                        Nothing was charged; try again shortly.
                      type: api_error
                      param: null
                      code: provider_unavailable
                      request_id: REQUEST_ID
                invalid_provider_response:
                  summary: The provider's answer could not be read
                  value:
                    error:
                      message: The video response could not be read.
                      type: api_error
                      param: null
                      code: invalid_provider_response
                      request_id: REQUEST_ID
          headers:
            x-hopscotch-request-id:
              $ref: '#/components/headers/RequestId'
      security:
        - customerApiKey: []
      servers:
        - url: https://api.hopscotchlabs.ai
          description: Production
components:
  headers:
    RequestId:
      description: >-
        Our id for this request. Quote it when you contact support. Present on
        every response, errors included.
      schema:
        type: string
  schemas:
    Error:
      type: object
      description: The error envelope. One top-level `error` key, always, at every status.
      required:
        - error
      additionalProperties: false
      properties:
        error:
          type: object
          required:
            - message
            - type
            - param
            - code
          additionalProperties: false
          properties:
            message:
              type: string
              description: Prose for a person. It may be reworded, so do not branch on it.
            type:
              type: string
              description: The category an SDK branches on. A closed set.
              enum:
                - invalid_request_error
                - authentication_error
                - permission_error
                - not_found_error
                - rate_limit_error
                - api_error
                - insufficient_quota
                - server_error
            param:
              type: string
              nullable: true
              description: >-
                The request field at fault, or null. Present and null rather
                than absent.
            code:
              type: string
              nullable: true
              description: The stable machine-readable reason. Branch on this.
            request_id:
              type: string
              description: >-
                Our id for this request, the same value as the
                x-hopscotch-request-id header. Quote it when you contact
                support.
  securitySchemes:
    customerApiKey:
      type: http
      scheme: bearer
      description: >-
        A workspace API key in an `Authorization: Bearer` header. A missing
        header, a scheme other than Bearer, a key of the wrong shape, and a key
        we reject are all 401.

````

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