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
Authentication
Add Authorization: Bearer <API_KEY> to the request headers to authenticate. You can generate a key on the console "API Keys" page.
curl https://api.mosi.cn/v1/audio/voices \
-H "Authorization: Bearer $MOSS_API_KEY"
Request fields
| Field | Type | Required | Description |
|---|---|---|---|
| audio_sample | multipart file | Yes | Reference audio file; only multipart supports this field. |
| name | string | No | Voice name. |
| description | string | No | 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
| Field | Type | Always returned | Description |
|---|---|---|---|
| id | string | Yes | voice id; referenced by endpoints such as TTS/TTSD. |
| object | string | Yes | Fixed as |
| name | string | Yes | Voice name; may be an empty string when |
| created_at | integer | Yes | Creation time, a Unix timestamp in seconds. |
Response example
{
"id": "<voice_id>",
"object": "audio.voice",
"name": "Alice",
"created_at": 1710000000
}