API Platform

Create Voice

Create/clone a new voice from an audio sample. This endpoint supports only multipart/form-data, and the reference audio is provided via the audio_sample file field. The current /v1 does not register GET /v1/audio/voices/{voice_id}.

POST
/v1/audio/voices

Create/clone a voice from an audio_sample reference audio, returning an audio.voice object with a voice id.

Authentication

Add Authorization: Bearer <API_KEY> to the request headers to authenticate. You can generate a key on the console "API Keys" page.

Example
curl https://api.mosi.cn/v1/audio/voices \
  -H "Authorization: Bearer $MOSS_API_KEY"

Request fields

FieldTypeRequiredDescription
audio_samplemultipart fileYes

Reference audio file; only multipart supports this field.

namestringNo

Voice name.

descriptionstringNo

Voice description.

Request example

curl -X POST https://api.mosi.cn/v1/audio/voices \
  -H "Authorization: Bearer $MOSS_API_KEY" \
  -F audio_sample=@sample.wav \
  -F name=Alice

Response fields

FieldTypeAlways returnedDescription
idstringYes

voice id; referenced by endpoints such as TTS/TTSD.

objectstringYes

Fixed as audio.voice.

namestringYes

Voice name; may be an empty string when name is not provided.

created_atintegerYes

Creation time, a Unix timestamp in seconds.

Response example

Response example
{
  "id": "<voice_id>",
  "object": "audio.voice",
  "name": "Alice",
  "created_at": 1710000000
}

Next steps