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

# Create Video from Audio

> Generate an AI avatar video from an audio file or url



## OpenAPI

````yaml post /project/assets/generate_video_from_audio/
openapi: 3.0.3
info:
  title: DeepReel API Documentation (latest)
  version: 1.0.0
  description: DeepReel API OpenApi Specification
  x-logo:
    url: /icons/deepreel-logo-main.png
servers: []
security: []
paths:
  /project/assets/generate_video_from_audio/:
    post:
      tags:
        - project
      description: Generate an AI avatar video from an audio file or url.
      operationId: Generate Video from Audio
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateVideoFromAudioUrlRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/GenerateVideoFromAudioFileRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateVideoResponse'
          description: ''
        '400':
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    nullable: false
                    description: Text of the error message.
                  detail:
                    type: object
                    nullable: true
                    description: Detail of the error message.
          description: ''
      security:
        - apiKeyAuth: []
components:
  schemas:
    GenerateVideoFromAudioUrlRequest:
      type: object
      properties:
        avatar_id:
          type: string
          format: uuid
          description: The avatar to be used to generate the video
        background_color:
          type: string
          default: '#3D3D3D'
          description: >-
            The background color video. A six-bit hex color code starts with #.
            (e.g. #DRDRDR)                                      NOTE: The
            `background_image` will get preference over `background_color` if
            both are specified.
        background_image:
          type: string
          format: uri
          nullable: true
          description: A public HTTPS link of an image (jpg/jpeg/png).
        aspect_ratio:
          allOf:
            - $ref: '#/components/schemas/AspectRatioEnum'
          description: |-
            Aspect ratio of the video.

            * `16:9` - 16:9 - Standard widescreen
            * `9:16` - 9:16 - Vertical
            * `4:3` - 4:3 - Traditional TV format
            * `1:1` - 1:1 - Square
        title:
          type: string
          nullable: true
          description: Title of the video. Length should be less than 100 characters.
        audio_url:
          type: string
          format: uri
          description: A public HTTPS link of an audio file (mp3).
      required:
        - aspect_ratio
        - audio_url
        - avatar_id
    GenerateVideoFromAudioFileRequest:
      type: object
      properties:
        avatar_id:
          type: string
          format: uuid
          description: The avatar to be used to generate the video
        background_color:
          type: string
          default: '#3D3D3D'
          description: >-
            The background color video. A six-bit hex color code starts with #.
            (e.g. #DRDRDR)                                      NOTE: The
            `background_image` will get preference over `background_color` if
            both are specified.
        background_image:
          type: string
          format: uri
          nullable: true
          description: A public HTTPS link of an image (jpg/jpeg/png).
        aspect_ratio:
          allOf:
            - $ref: '#/components/schemas/AspectRatioEnum'
          description: |-
            Aspect ratio of the video.

            * `16:9` - 16:9 - Standard widescreen
            * `9:16` - 9:16 - Vertical
            * `4:3` - 4:3 - Traditional TV format
            * `1:1` - 1:1 - Square
        title:
          type: string
          nullable: true
          description: Title of the video. Length should be less than 100 characters.
        audio_file:
          type: string
          format: uri
          description: An audio file. (mp3). Size max limit is 5 mb.
      required:
        - aspect_ratio
        - audio_file
        - avatar_id
    GenerateVideoResponse:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique Identifier of the video.
        estimated_completion_time:
          type: integer
          description: Video generation estimated completion time in seconds.
        message:
          type: string
          description: Extra detail.
      required:
        - id
    AspectRatioEnum:
      enum:
        - '16:9'
        - '9:16'
        - '4:3'
        - '1:1'
      type: string
      description: |-
        * `16:9` - 16:9 - Standard widescreen
        * `9:16` - 9:16 - Vertical
        * `4:3` - 4:3 - Traditional TV format
        * `1:1` - 1:1 - Square
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        Your API key with the prefix: `dr_`. This is required by all endpoints
        to access our API programatically.                             You can
        view your API Key by navigating to the account settings panel (In the
        bottom left corner click on your                             `Account` →
        `profile`)

````