# Creative Lab voice catalog

Source: [Creative Lab voice catalog](<https://docs.gptunnel.ru/en/creative-lab/voices/>)

<a id="_top"></a>
> **Note: Authentication**
>
> You need an API key to send requests. See [Quick start](<https://docs.gptunnel.ru/en/>)

<a id="suno-saved-voices"></a>
## Suno Saved Voices

Pass `?model=suno` to list saved Suno voices for the API key owner. The response includes `id`, `name`, `model` and `supports_instrumental` for each voice. Pass the ID in `params.voice_id`. See the [complete generation example](<https://docs.gptunnel.ru/en/creative-lab/suno/#saved-voice>).

<a id="request-for-voice-list"></a>
## Request for voice list

`GET https://gptunnel.ru/api/v2/media/voices`

This endpoint lists the text-to-speech voices available to your API key. Use an `id` from the response as `params.voice` when [creating a task](<https://docs.gptunnel.ru/en/creative-lab/create-task/>).

The voice catalog changes independently of the [model catalog](<https://docs.gptunnel.ru/en/creative-lab/models/>). Use this endpoint for current `voice` values.

### Query parameters

| Parameter | Type | Description |
| --- | --- | --- |
| `model` | `string` | Voice model filter. If omitted or set to tts2, the API returns voices for all text-to-speech models. |

<a id="example-request"></a>
### Example request

Set the `GPTUNNEL_API_KEY` environment variable.

<a id="tab-panel-0-0"></a>
**Python**

```python
import json
import os
from urllib.request import Request, urlopen

url = 'https://gptunnel.ru/api/v2/media/voices'
request = Request(url, headers={'Authorization': os.environ['GPTUNNEL_API_KEY']})
with urlopen(request, timeout=30) as response:
    print(json.load(response)['voices'])
```

<a id="tab-panel-0-1"></a>
**cURL**

```bash
curl --fail-with-body 'https://gptunnel.ru/api/v2/media/voices' \
  --header "Authorization: ${GPTUNNEL_API_KEY:?Set GPTUNNEL_API_KEY}"
```

<a id="tab-panel-0-2"></a>
**JavaScript (Node.js)**

```javascript
const key = process.env.GPTUNNEL_API_KEY
if (!key) throw new Error('Set GPTUNNEL_API_KEY')
const response = await fetch('https://gptunnel.ru/api/v2/media/voices', { headers: { Authorization: key } })
if (!response.ok) throw new Error(await response.text())
const data = await response.json()
console.log(data.voices)
```

<a id="example-response"></a>
### Example response

The following excerpt shows the main fields for one voice. Use your own catalog for current IDs and complete details.

```json
{
  "code": 0,
  "voices": [
    {
      "id": "69e7737a97a24533bd8ffca9",
      "name": "Виктор",
      "model": "tts2",
      "gender": "male",
      "language": "ru"
    }
  ]
}
```

The voice in this example has no custom rate, so its response omits `price_per_1k_chars`. Other voices can have their own rate. Send the voice ID and the text to [get a price quote](<https://docs.gptunnel.ru/en/creative-lab/price/>).

This example of a cloned voice shows the `custom` field. For `<CLONED_VOICE_ID>`, use an ID from your catalog.

```json
{
  "id": "<CLONED_VOICE_ID>",
  "name": "Мой клон",
  "model": "tts2",
  "custom": true
}
```

<a id="voice-fields"></a>
### Voice Fields

| Parameter | Type | Description |
| --- | --- | --- |
| `id` (required) | `string` | Value for params.voice in creating the task |
| `name` (required) | `string` | Voice name |
| `model` (required) | `string` | Model ID to pass in model when using this voice. Its rate applies when the voice has no custom rate. |
| `description` | `string` | Voice characteristics and intended uses |
| `gender` | `string` | Voice gender |
| `language` (required) | `string` | Primary language, for example ru-RU |
| `tags` (required) | `string[]` | The filtering tags in your interface |
| `preview_url` | `string` | URL of the voice sample |
| `avatar_url` | `string` | URL of the voice avatar |
| `price_per_1k_chars` | `number` | Voice rate in RUB per 1,000 characters. If this field is absent, billing uses the rate of the model in model. Get a quote for the exact price. |
| `custom` | `boolean` | cloned voice: visible only to the key holder |
| `expires_at` | `number` | Unix timestamp at which the cloned voice expires. Each generation using the voice extends its lifetime by 5 days. |

<a id="how-to-use"></a>
## How to Use

Before generating speech, submit the same text and `params.voice` to the [price endpoint](<https://docs.gptunnel.ru/en/creative-lab/price/>). The rate can depend on the selected voice.

```json
{
  "model": "tts2",
  "prompt": "Привет! Это проверка озвучки.",
  "params": { "voice": "69e7737a97a24533bd8ffca9" }
}
```

Task creation with a voice absent from this catalog returns HTTP 400 with `code: 3` and the `voice` field in `details`. The account is not charged.

> **Caution: The v1 catalog uses different voice IDs**
>
> The legacy `/v1/tts/voices` endpoint returns a different catalog. For `/api/v2/media/tasks`, use IDs from `/api/v2/media/voices`.
