API Platform

Clone a Voice

Upload a reference audio file to create a reusable voice_id for later use when generating speech with TTS or TTSD.

Workflow

POST /v1/audio/voices

Endpoint

Voice Management Service

Model

  1. Create an API Key

    Open the API Key management platform, create an API Key, and save it as an environment variable. Do not write the API Key into client-side code or commit it to a repository.

    Example
    export MOSS_API_KEY="<your-api-key>"
    
  2. Prepare the reference audio

    Prepare a reference audio file. Voice creation supports only multipart/form-data; the reference audio is uploaded via the audio_sample file field. A JSON body, file_id, or audio_url is not supported.

    audio_sample: reference audio file (multipart) name: voice name description: voice description

  3. Create the voice

    Create a voice from the reference audio file, optionally passing name and description. This endpoint supports only multipart/form-data.

    curl https://api.mosi.cn/v1/audio/voices \
      -H "Authorization: Bearer $MOSS_API_KEY" \
      -F audio_sample=@sample.wav \
      -F name=customer-service-voice
    
  4. Verify success

    Success indicator: the response returns a reusable voice_id, which you can reference via voice or voice_id in subsequent TTS / TTSD calls.

Next steps