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

# Generate Static Video

> Generate and stream a static video file from a given audio sample. The whole request body may be at most 5 MB, and the audio at most 30 minutes long. The video is private: the returned URLs are signed (they carry an access token valid for 6 hours) and its files are served on a signed URL only. POST /static/audio/sign issues fresh ones.



## OpenAPI

````yaml https://api.simli.ai/openapi.yaml post /static/audio
openapi: 3.1.0
info:
  title: Simli
  version: 1.0.0
servers:
  - url: https://api.simli.ai/
    description: API server
security:
  - ApiKeyAuth: []
paths:
  /static/audio:
    post:
      summary: Generate Static Video
      description: >-
        Generate and stream a static video file from a given audio sample. The
        whole request body may be at most 5 MB, and the audio at most 30 minutes
        long. The video is private: the returned URLs are signed (they carry an
        access token valid for 6 hours) and its files are served on a signed URL
        only. POST /static/audio/sign issues fresh ones.
      operationId: audioToVideoInterface_static_audio_post
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AudioToVideoRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                contentMediaType: application/json
                properties:
                  hls_url:
                    type: string
                    example: >-
                      https://api.simli.ai/hls/path-to-file/output.m3u8?token=1794500000.q0J...
                  mp4_url:
                    type: string
                    example: >-
                      https://api.simli.ai/mp4/path-to-file/output.mp4?token=1794500000.q0J...
                  access_token:
                    type: string
                    description: >-
                      The token both URLs carry as `?token=`. The playlist's
                      segment URLs carry it too.
                  access_token_expires_at:
                    type: integer
                    description: >-
                      Unix time (seconds) the signed URLs stop working, 6 hours
                      after the request.
                  warnings:
                    type: array
                    items:
                      type: string
                    description: >-
                      Camera fields outside their supported range, and
                      background_id / foreground_id dropped as not your
                      account's (the avatar's own is used). The video is made
                      regardless.
        '413':
          description: The request body is over 5 MB
        '422':
          description: Validation Error, or audio longer than 30 minutes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AudioToVideoRequest:
      properties:
        faceId:
          type: string
          title: Faceid
        audioBase64:
          type: string
          title: Audiobase64
        audioFormat:
          type: string
          enum:
            - pcm16
            - pcm32
            - wav
            - mp3
            - ogg
          title: Audioformat
        audioSampleRate:
          type: integer
          title: Audiosamplerate
          default: 16000
        audioChannelCount:
          type: integer
          title: Audiochannelcount
          default: 1
        videoStartingFrame:
          type: integer
          title: Videostartingframe
          default: 0
        streaming_width:
          type: integer
          title: Streaming Width
          default: 768
          minimum: 512
          description: >-
            Width of the video in pixels, Trinity-2 faces only (the others keep
            their own frame size). At least 512, and with streaming_height one
            of 1:1, 16:9 or 9:16, otherwise a 422. A canvas larger than the
            avatar's frame is padded with its background; a smaller one crops a
            window out of it.
        streaming_height:
          type: integer
          title: Streaming Height
          default: 768
          minimum: 512
          description: Height of the video in pixels. See streaming_width.
        avatar_position_x:
          type: number
          title: Avatar Position X
          default: 0.5
          minimum: 0
          maximum: 1
          description: >-
            Where the avatar sits across the canvas, from 0 (left) to 1 (right).
            Trinity-2 only.
        avatar_position_y:
          type: number
          title: Avatar Position Y
          default: 1
          minimum: 0
          maximum: 1
          description: >-
            Where the avatar sits down the canvas, from 0 (top) to 1 (bottom).
            Trinity-2 only.
        camera:
          anyOf:
            - $ref: '#/components/schemas/CameraSetting'
            - type: 'null'
          description: >-
            The camera the video starts with, on top of the avatar's own
            framing. Trinity-2 only. Leave it out to keep the avatar's framing.
        background_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Background Id
          description: >-
            One of your uploaded backgrounds, by the id POST /assets/backgrounds
            returned, to show behind the avatar, cropped to fill the canvas.
            Trinity-2 only. Leave it out for the avatar's own. An id that is not
            one of your account's is dropped with a warning, and the video uses
            the avatar's own. An image is not accepted: upload it first.
        foreground_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Foreground Id
          description: >-
            One of your uploaded foregrounds, by the id POST /assets/foregrounds
            returned, laid over the avatar through its transparency and cropped
            to fill the canvas. Trinity-2 only; otherwise as background_id.
      type: object
      required:
        - faceId
        - audioBase64
        - audioFormat
      title: AudioToVideoRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CameraSetting:
      type: object
      title: CameraSetting
      description: >-
        Camera offsets on top of the avatar's own framing. Every field is
        optional and neutral when left out. A value outside its supported range
        is still applied, and the response lists a warning for it; NaN and
        infinity are a 422.
      properties:
        pos_x_off:
          type: number
          default: 0
          description: >-
            Moves the avatar right, in half canvas widths. Supported range -10
            to 10.
        pos_y_off:
          type: number
          default: 0
          description: >-
            Moves the avatar down, in half canvas heights. Supported range -10
            to 10.
        pos_z_off:
          type: number
          default: 0
          description: >-
            Metres the camera backs away from the avatar (negative moves in).
            Supported range -5 to 5.
        rot_x_off:
          type: number
          default: 0
          description: Degrees the camera tilts up (pitch). Supported range -180 to 180.
        rot_y_off:
          type: number
          default: 0
          description: Degrees the camera pans right (yaw). Supported range -180 to 180.
        rot_z_off:
          type: number
          default: 0
          description: Degrees the camera rolls clockwise. Supported range -180 to 180.
        zoom:
          type: number
          default: 1
          description: >-
            Multiplies the avatar's zoom; 1 is no change. Supported range above
            0, up to 4.
        orbit_x_off:
          type: number
          default: 0
          description: >-
            Degrees the camera orbits up over the avatar's head (elevation).
            Supported range -80 to 80.
        orbit_y_off:
          type: number
          default: 0
          description: >-
            Degrees the camera orbits round to its right (azimuth). Supported
            range -180 to 180.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-simli-api-key

````

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