> ## 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.

# Upload audio

> Uploads up to 10 audio files and starts transcribing each one in the background.

Send the files as `multipart/form-data` under the field name **`files`** (plural). Up to 10 files per request, 100 MB each. WAV and MP3 work; other common formats (M4A, FLAC, OGG) are generally accepted.

The response returns straight away with one `attachmentId` per file. Transcription runs in the background.

> [!WARNING]
>
> `attachmentIds` are **file** IDs, not transcript IDs. To poll a transcript, find its `id` with [List transcripts](https://docs.olimi.ai/api-reference/endpoint/speech/list-stt.md) first. See [How it works](https://docs.olimi.ai/api-reference/endpoint/speech/speech-to-text.md#how-it-works).

To translate the transcripts, send `languageId` as a form field (or as a query parameter). See [Translation](https://docs.olimi.ai/api-reference/endpoint/speech/speech-to-text.md#translation).


## OpenAPI

````yaml post /api/v2/stt/upload
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/stt/upload:
    post:
      tags:
        - Speech to Text
      summary: Upload audio
      description: >-
        Uploads up to 10 audio files and starts transcribing each one in the
        background.
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - files
              properties:
                files:
                  type: string
                  format: binary
                  description: >-
                    An audio file, under the field name `files` (plural). To
                    upload several, repeat the field, up to 10 files, 100 MB
                    each.
                languageId:
                  type: string
                  format: uuid
                  description: >-
                    Translate the transcripts into this language, for example
                    English (`cd2d9868-1910-40bf-88f7-c490483ac01a`). Leave it
                    out to get them in the spoken language. See
                    [Translation](/api-reference/endpoint/speech/speech-to-text#translation).
                  example: cd2d9868-1910-40bf-88f7-c490483ac01a
      responses:
        '200':
          description: The files were uploaded and transcription started.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SttUploadResponse'
        '400':
          description: >-
            No files were sent, the field name isn't `files`, more than 10 files
            were sent, `languageId` doesn't exist, or transcription couldn't be
            started.
          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: A file is larger than 100 MB.
      security:
        - apiKeyAuth: []
components:
  schemas:
    SttUploadResponse:
      type: object
      properties:
        message:
          type: string
          example: Audio files uploaded and transcriptions initiated successfully
        data:
          type: object
          properties:
            attachmentIds:
              type: array
              items:
                type: string
                format: uuid
              description: >-
                One ID per uploaded file, in upload order. These are file IDs,
                not transcript IDs.
              example:
                - 3c63b9cd-208b-498e-a644-6f1d8aa158a1
    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
  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.