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

# Create a harmony

> Starts a harmony from one of Audimee's presets: the input vocal is converted once per track, each track sung by its own built-in voice on its own harmony line in the musical `key` you supply. The input may be at most 75 seconds long, and a harmony uses conversion time equal to the input length × the number of tracks.

The response returns the harmony `id` once the input's pitch has been analysed — usually a few seconds, up to about a minute when that service is starting up — so use a client timeout of at least 120 seconds and don't retry after a timeout: the harmony may already exist. The tracks then render asynchronously; poll `GET /harmonies/{id}` for progress.



## OpenAPI

````yaml POST /harmonies
openapi: 3.1.0
info:
  title: Audimee API
  description: >-
    The Audimee API lets clients browse voice models, train custom voices, run
    AI voice conversions, and create multi-voice harmonies.
  version: 1.0.0
servers:
  - url: https://audimee.com/api/v1
security:
  - bearerAuth: []
paths:
  /harmonies:
    post:
      tags:
        - Harmonies
      summary: Create a harmony
      description: >-
        Starts a harmony from one of Audimee's presets: the input vocal is
        converted once per track, each track sung by its own built-in voice on
        its own harmony line in the musical `key` you supply. The input may be
        at most 75 seconds long, and a harmony uses conversion time equal to the
        input length × the number of tracks.


        The response returns the harmony `id` once the input's pitch has been
        analysed — usually a few seconds, up to about a minute when that service
        is starting up — so use a client timeout of at least 120 seconds and
        don't retry after a timeout: the harmony may already exist. The tracks
        then render asynchronously; poll `GET /harmonies/{id}` for progress.
      operationId: createHarmony
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateHarmonyRequest'
            example:
              inputFileUrl: https://example.com/audio/lead-vocal.wav
              key: C Maj
              presetId: '1'
      responses:
        '200':
          description: >-
            Harmony created and its tracks queued for rendering. Poll `GET
            /harmonies/{id}` for progress.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateHarmonyResponse'
              example:
                id: 0c8f6f0e-3a43-4b6e-9a8a-2d3f6b1c9e57
        '400':
          description: >-
            Invalid body, input audio too long, or not enough conversion time
            left.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidJson:
                  summary: Body is not valid JSON
                  value:
                    error: Request body must be valid JSON
                invalidUrl:
                  summary: inputFileUrl is not a URL
                  value:
                    error: 'inputFileUrl: Invalid url'
                notPublicUrl:
                  summary: inputFileUrl is not a public http(s) address
                  value:
                    error: >-
                      inputFileUrl must be a publicly reachable http or https
                      URL
                invalidKey:
                  summary: Unknown key
                  value:
                    error: >-
                      key: Must be one of: C Maj, C Min, C# Maj, C# Min, D Maj,
                      D Min, D# Maj, D# Min, E Maj, E Min, F Maj, F Min, F# Maj,
                      F# Min, G Maj, G Min, G# Maj, G# Min, A Maj, A Min, A#
                      Maj, A# Min, B Maj, B Min
                inputTooLong:
                  summary: Input audio longer than 75 seconds
                  value:
                    error: Input audio length (76s) exceeds maximum of 75s
                notEnoughConversionTime:
                  summary: Not enough conversion time left
                  value:
                    error: >-
                      Not enough conversion time left: this harmony needs 90s
                      (input length × number of tracks)
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: >-
            No harmony preset has this id. Use an `id` returned by `GET
            /harmony-presets`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: 'Harmony preset not found: 999'
        '500':
          description: >-
            Failed to download or process the input audio, analyze its pitch, or
            persist the harmony.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                downloadFailed:
                  summary: Could not download the input audio
                  value:
                    error: Failed to download audio file
                lengthFailed:
                  summary: Could not read audio length
                  value:
                    error: Failed to get audio length
                uploadFailed:
                  summary: Could not upload to storage
                  value:
                    error: Failed to upload file
                pitchFailed:
                  summary: Could not analyze the input's pitch
                  value:
                    error: Failed to analyze pitch of audio file
                createFailed:
                  summary: Could not create the harmony
                  value:
                    error: Failed to create harmony
components:
  schemas:
    CreateHarmonyRequest:
      type: object
      required:
        - inputFileUrl
        - key
        - presetId
      properties:
        inputFileUrl:
          type: string
          format: uri
          description: >-
            `http` or `https` URL to the vocal to harmonize, at most 75 seconds
            long. The server downloads it server-side, so the URL must be
            reachable from the public internet for the duration of the request;
            URLs that resolve to private or internal addresses are rejected.
        key:
          type: string
          enum:
            - C Maj
            - C Min
            - C# Maj
            - C# Min
            - D Maj
            - D Min
            - D# Maj
            - D# Min
            - E Maj
            - E Min
            - F Maj
            - F Min
            - F# Maj
            - F# Min
            - G Maj
            - G Min
            - G# Maj
            - G# Min
            - A Maj
            - A Min
            - A# Maj
            - A# Min
            - B Maj
            - B Min
          description: >-
            Musical key of the input. Harmony lines are built from the notes of
            this key, so a wrong key produces wrong-sounding harmonies.
        presetId:
          type: string
          description: >-
            `id` of the harmony preset to use, as returned by `GET
            /harmony-presets` — for example `1`.
    CreateHarmonyResponse:
      type: object
      required:
        - id
      properties:
        id:
          type: string
          format: uuid
          description: UUID of the queued harmony.
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Human-readable explanation of what went wrong.
  responses:
    Unauthorized:
      description: Missing, malformed, or unrecognised bearer token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            missingHeader:
              summary: No Authorization header
              value:
                error: Missing or invalid Authorization header
            invalidToken:
              summary: Token not recognised
              value:
                error: Invalid authorization token
            userNotFound:
              summary: Token valid but user no longer exists
              value:
                error: User not found
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Static API key issued by Audimee, passed as `Authorization: Bearer
        {token}`.

````

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