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

# Create a video

> Uploads an audio file and starts turning it into a video of the chosen avatar speaking it.

Send `multipart/form-data` with the audio under the field name **`audio`** (singular, one file), plus the avatar's `configId`. Common audio formats such as MP3 and WAV work.

The response comes back straight away with `status: "queued"`, `progress: "0.00"` and no video yet. The video is generated in the background:

1. **Poll:** call [Get video progress](https://docs.olimi.ai/api-reference/endpoint/speech/get-stv-progress.md) with the returned `id` every few seconds.
2. **Stop polling** when `status` is `completed`, `failed` or `cancelled`.
3. **Download:** once it's `completed`, use [Download a video](https://docs.olimi.ai/api-reference/endpoint/speech/download-stv.md).

> [!WARNING]
>
> An unknown `configId` isn't rejected here. The video is created and then ends with `status: "failed"`. Take `configId` from [List avatars](https://docs.olimi.ai/api-reference/endpoint/speech/list-stv-avatars.md).


## OpenAPI

````yaml post /api/v2/stv
openapi: 3.0.1
info:
  title: Customer Management API
  description: API for managing customer lists and customers within those lists
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api-eg.olimi.ai
security:
  - bearerAuth: []
paths:
  /api/v2/stv:
    post:
      tags:
        - Speech to Video
      summary: Create a video
      description: >-
        Uploads an audio file and starts turning it into a video of the chosen
        avatar speaking it.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - audio
                - configId
              properties:
                audio:
                  type: string
                  format: binary
                  description: >-
                    The speech, as an audio file, under the field name `audio`.
                    Up to 100 MB.
                configId:
                  type: string
                  description: >-
                    The avatar's `model_config_id`, from [List
                    avatars](/api-reference/endpoint/speech/list-stv-avatars).
                  example: 4f0cda01-bd22-410c-8b2e-026ce07691da
                name:
                  type: string
                  description: A label for the video.
                  example: Welcome message
      responses:
        '201':
          description: The new video, with `status` `queued`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StvCreateResponse'
        '400':
          description: >-
            `audio` is missing, or the video service rejected the job. An
            unknown `configId` is NOT rejected here: the video is created and
            then fails.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NestBadRequest'
        '401':
          description: The `X-API-KEY` header is missing or the key isn't valid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '413':
          description: The audio file is larger than 100 MB.
        '422':
          description: '`configId` is missing.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
      security:
        - apiKeyAuth: []
components:
  schemas:
    StvCreateResponse:
      type: object
      properties:
        message:
          type: string
          example: Video generation job created successfully
        data:
          $ref: '#/components/schemas/StvVideoCreated'
    NestBadRequest:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          type: string
          example: No audio files provided
        error:
          type: string
          example: Bad Request
    ApiError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 404
        errorCode:
          type: string
          description: Machine-readable error code.
          example: agent_not_found
        message:
          type: string
          description: Human-readable text. May change; don't match on it.
          example: Agent not found
    ValidationError:
      type: object
      properties:
        statusCode:
          type: integer
          example: 422
        message:
          type: array
          items:
            type: string
          description: What went wrong. Human-readable.
          example:
            - name must be shorter than or equal to 100 characters
        error:
          type: string
          example: Unprocessable Entity
    StvVideoCreated:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The video's ID.
          example: 7a3e9c12-5d8b-4f61-a2c7-9e0b3d6f1a48
        name:
          type: string
          nullable: true
          description: Your label, if you sent one.
          example: Welcome message
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
            - cancelled
          description: >-
            See [Status
            values](/api-reference/endpoint/speech/speech-to-video#status-values).
          example: queued
        progress:
          type: string
          description: >-
            How far along it is, from `"0.00"` to `"1.00"` (a decimal, as a
            string).
          example: '0.00'
        configId:
          type: string
          description: The avatar used.
          example: 4f0cda01-bd22-410c-8b2e-026ce07691da
        audioAttachmentId:
          type: string
          format: uuid
          example: b1c9e4d2-7f3a-4e85-9b60-2d8f5a1c7e39
        videoAttachmentId:
          type: string
          format: uuid
          nullable: true
          description: '`null` until the video is ready.'
          example: null
        createdAt:
          type: string
          format: date-time
          example: '2026-09-29T10:02:11.904Z'
        updatedAt:
          type: string
          format: date-time
          example: '2026-09-29T10:02:11.904Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````

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