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

# Create Voice

> Save a custom voice from an audio sample

Upload an audio sample and create a custom voice for your workspace. The voice can then be used in future song creations.

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key
</ParamField>

<ParamField header="Content-Type" type="string" required>
  multipart/form-data
</ParamField>

### Body (Multipart)

<ParamField body="name" type="string" required>
  Display name for the voice (≤200 chars)
</ParamField>

<ParamField body="voice_reference" type="file" required>
  Audio file (wav/flac/mp3/m4a/ogg, 3–30 seconds, ≤10 MB)
</ParamField>

<ParamField body="consent" type="string" required>
  Must be `"true"`. The caller attests they have permission to use this voice.
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  True on success
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="Voice object">
    <ResponseField name="voice_id" type="string">Unique voice identifier</ResponseField>
    <ResponseField name="name" type="string">Display name</ResponseField>
    <ResponseField name="gender" type="string">Detected gender</ResponseField>
    <ResponseField name="language" type="string">Detected language</ResponseField>
    <ResponseField name="preview_url" type="null">Always null for custom voices</ResponseField>
  </Expandable>
</ResponseField>

## Errors

| Status | Meaning                                                  |
| ------ | -------------------------------------------------------- |
| 400    | Invalid audio format, duration, size, or missing consent |
| 403    | Consent not given ("true")                               |

## Example

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.60db.ai/songs/voices \
    -H "Authorization: Bearer your-api-key" \
    -F "name=My Brand Voice" \
    -F "voice_reference=@voice-sample.wav" \
    -F "consent=true"
  ```

  ```javascript JavaScript theme={null}
  const voiceFile = document.querySelector('input[type="file"]').files[0];
  const voice = await client.music.createVoice({
    name: 'My Brand Voice',
    file: voiceFile
  });
  console.log('Voice ID:', voice.data.voice_id);
  ```

  ```python Python theme={null}
  with open('voice-sample.wav', 'rb') as f:
      voice = client.music.create_voice(
          name='My Brand Voice',
          file=f
      )
      print('Voice ID:', voice['data']['voice_id'])
  ```
</RequestExample>
