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

# Upscale a video

> POST /v1/video/upscale

The video counterpart of [image upscaling](/api-reference/images/upscale): the video is enlarged, nothing about its content is directed.

Returns on the same request, so expect it to be slow for anything long.


## OpenAPI

````yaml openapi.json POST /v1/video/upscale
openapi: 3.0.0
info:
  title: Infery Gateway
  description: >-
    Infery Inference Gateway — OpenAI-compatible API for LLMs, embeddings,
    images, audio, and video
  version: '1.0'
  contact: {}
servers:
  - url: https://api.infery.ai
    description: Production
  - url: http://localhost:3001
    description: Local
security: []
tags: []
paths:
  /v1/video/upscale:
    post:
      tags:
        - Video
      summary: Upscale a video
      description: >-
        Runs a video super-resolution model and returns the result on the same
        request. There is no prompt: the video is enlarged, nothing about its
        content is directed.


        Only FAL-served models of `upscale` modality that accept a video input
        are eligible; an image upscaler is refused with 400 and directed to
        `POST /v1/images/upscale`, and that check is made against the catalogued
        model rather than the body, so it cannot be worked around by also
        sending a video.


        BILLED, and video upscalers are near-always priced per second of
        compute. Credits are reserved up front against the worst case the model
        declares and settled against what it actually used, clamped to the
        reserve — so `credits_used` is never larger than the hold. The API key's
        rate limit, allowed-model list and budget are enforced before the
        provider is called.


        The provider is submitted to and polled inside this request, so the call
        can take minutes. Should the gateway stop waiting, it answers 504 with a
        `job_id` in the error body — the work carries on server-side and is
        still billed, and the result is then collected from `GET
        /v1/images/jobs/{id}`.
      operationId: createVideoUpscale
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVideoUpscaleDto'
      responses:
        '200':
          description: The upscaled video. `data` normally holds a single artifact.
          headers:
            x-request-id:
              schema:
                type: string
              description: Correlation id for this request
            x-model-used:
              schema:
                type: string
              description: >-
                Slug of the model that actually handled the request (differs
                from the requested one when fallback fires)
            x-fallback-from:
              schema:
                type: string
              description: 'Present only when fallback fired: the slug originally requested'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaGenerationResponseDto'
        '400':
          description: >-
            Invalid request — missing `model`/`video_url`, or a model that is
            not a FAL video upscaler
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '401':
          description: Unauthorized — invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '403':
          description: Quota exceeded (rate limit / model not allowed / budget)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '404':
          description: Model not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
        '504':
          description: >-
            The gateway stopped waiting. The job continues and is still billed —
            collect it from `GET /v1/images/jobs/{id}` using the `job_id` in the
            error body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseDto'
      security:
        - ApiKey: []
components:
  schemas:
    CreateVideoUpscaleDto:
      type: object
      properties:
        model:
          type: string
          description: >-
            Slug of the upscale model to run, as listed by `GET /v1/models`.
            Must be an `upscale`-modality model that accepts a video input and
            is served by FAL; an image upscaler is rejected with 400 and
            directed to `POST /v1/images/upscale`.
        video_url:
          type: string
          description: Source video to upscale, as a URL or a data URI. Required.
          example: https://example.com/clip.mp4
        scale:
          type: number
          description: >-
            Upscale factor. Forwarded onto whichever of the model's own input
            fields is named `scale`, `upscale_factor` or `upscaling_factor`;
            silently ignored by a model that declares none of them. Omit to use
            the model's own default.
          example: 2
      required:
        - model
        - video_url
    MediaGenerationResponseDto:
      type: object
      properties:
        created:
          type: integer
          description: Unix timestamp, in seconds, of when the result was produced.
          example: 1713204900
        data:
          description: >-
            One entry per produced artifact, in the order the provider returned
            them.
          type: array
          items:
            $ref: '#/components/schemas/MediaArtifactDto'
        credits_used:
          type: number
          description: >-
            Credits actually settled for this request (1 credit = $0.01).
            Settled against measured compute for per_second models, clamped to
            the amount reserved before the call, so it is never larger than the
            hold. May be fractional.
          example: 12.5
      required:
        - created
        - data
        - credits_used
    ErrorResponseDto:
      type: object
      properties:
        error:
          description: >-
            The error envelope. Every non-2xx response from this API has this
            shape, so a client can parse failures without branching on the
            endpoint.
          allOf:
            - $ref: '#/components/schemas/ErrorDetailDto'
      required:
        - error
    MediaArtifactDto:
      type: object
      properties:
        url:
          type: string
          description: >-
            Provider-hosted download URL for this artifact. These are the
            upstream (FAL) CDN links and expire in roughly an hour — download or
            copy the bytes promptly rather than storing the URL.
          example: https://example.com/upscaled.png
        file_id:
          type: string
          description: >-
            Identifier of the durable `ApiFile` this artifact was registered as,
            usable with `GET /v1/files/{fileId}` and `GET
            /v1/files/{fileId}/content`. Only produced on the media-job path,
            and omitted (never null) for an artifact whose registration failed —
            registration is bookkeeping and never blocks or reshapes `url`.
            Registered bytes count towards the workspace storage quota.
          example: file_1hR9xTPZqK4mVLc2nJ7fY5wB
      required:
        - url
    ErrorDetailDto:
      type: object
      properties:
        message:
          type: string
          example: Model not found
          description: Human-readable error message
        type:
          type: string
          example: invalid_request_error
          description: Error category
          enum:
            - invalid_request_error
            - authentication_error
            - permission_error
            - quota_exceeded
            - rate_limit_error
            - server_error
        code:
          type: string
          example: model_not_found
          nullable: true
          description: >-
            Stable machine-readable error code. Branch on this rather than on
            `message`, which is prose and may be reworded.
        param:
          type: string
          example: model
          nullable: true
          description: >-
            Name of the request parameter that triggered the error. `null` when
            the error is not attributable to one field.
        job_id:
          type: string
          example: job_1hR9xTPZqK4mVLc2nJ7fY5wB
          description: >-
            Handle to work that is ALREADY RUNNING AND ALREADY BILLED, present
            on the few errors that carry one. When it is here, this is not a
            failure to retry — retrying pays twice. Collect the result from `GET
            /v1/images/jobs/{job_id}`, which serves every durable media job
            regardless of modality.


            Two situations produce it. A media generation that outruns the
            gateway's wait answers `504` with `code: "job_timeout"` and keeps
            working. And `POST /v1/audio/speech` answers **500** with `code:
            "artifact_unreadable"` when the speech was generated and settled but
            could not be read back from storage — the audio exists and is paid
            for; only this response failed.


            Declared here rather than per-endpoint because the rule is about the
            FIELD, not the status: if this is present, there is a paid-for
            result to collect. It was undeclared until now, so a client
            generated from this document could not see the one field that
            recovers money already spent.
      required:
        - message
        - type
        - code
        - param
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: 'API key in format: Bearer inf_***'

````