# List voices

`GET https://my.neuronai.uz/api/v1/tts/voices`

API reference › Text to speech

Lists the stock voices, then your organization's voice clones.

No key is needed: without one, only stock voices are listed. A key that is sent is still checked.

**Authentication:** `Authorization: Bearer <API key>`, a key with `voices:read` (optional: without a key the answer is public).

## Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `type` | string \| null | No | `stock` or `custom`. Leave it out for both. One of `stock`, `custom`, `null`. |
| `language` | string \| null | No | Only voices in this language, such as `uz`. At most 16 characters. |
| `limit` | integer \| null | No | Voices per page, from 1 to 100. 50 by default. Minimum 1. Maximum 100. |
| `cursor` | string \| null | No | The `next_cursor` of the previous page. At most 512 characters. |

## Response (200, `application/json`)

Success.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | object[] | Yes |  |
| `data[].id` | string | Yes |  |
| `data[].name` | string | Yes |  |
| `data[].language` | string | Yes |  |
| `data[].tags` | string[] | Yes |  |
| `data[].type` | string | Yes | One of `custom`, `stock`. |
| `data[].category` | string \| null | No |  |
| `data[].ref_text` | string \| null | No |  |
| `data[].created_at` | string \| null | No |  |
| `next_cursor` | string \| null | Yes |  |
| `request_id` | string | Yes |  |

```json
{
  "data": [
    {
      "id": "7c4a8d09-ca37-4f3c-9e2b-1b0f3c2a9d41",
      "name": "Aziza",
      "language": "uz",
      "tags": [
        "calm"
      ],
      "type": "custom",
      "category": "narration",
      "ref_text": "Mening ismim Aziza, men sizga yordam berishga tayyorman.",
      "created_at": "2026-11-17T09:30:00Z"
    }
  ],
  "next_cursor": "eyJpZCI6NDJ9",
  "request_id": "7c4a8d09-ca37-4f3c-9e2b-1b0f3c2a9d41"
}
```

### Headers

| Header | Type | Description |
| --- | --- | --- |
| `X-Request-Id` | string | Identifies this request. A JSON body carries it as `request_id` too; quote it to support. |

## Errors

Every error has the same JSON shape:

```json
{
  "error": {
    "type": "invalid_request_error",
    "code": "invalid_request",
    "message": "The request is malformed or failed validation.",
    "param": null
  },
  "request_id": "7c4a8d09-ca37-4f3c-9e2b-1b0f3c2a9d41"
}
```

| Status | Meaning |
| --- | --- |
| 401 | The key sent is invalid, revoked, disabled or expired. A request without a key is answered as anonymous. |
| 403 | A key was sent, and the client IP is not in its allowlist: `ip_not_allowed`. |
| 422 | The request failed validation (`invalid_request`). `error.fields` names each invalid field. |
| 502 | The voice service could not list its voices: `upstream_error`. |
| default | Any other error, in the same shape, such as `server_error` (500) or `service_unavailable` (503). |

## Examples

### cURL

```bash
curl "https://my.neuronai.uz/api/v1/tts/voices?type=stock"
```

### TypeScript SDK

```typescript
import {NeuronAI} from "@naiuz/sdk";

const client = new NeuronAI();

for await (const voice of client.voices.list({type: "stock"})) {
    console.log(voice.id, voice.name);
}
```

### Python SDK

```python
from naiuz import NeuronAI

client = NeuronAI()

for voice in client.voices.list(type="stock"):
    print(voice.id, voice.name)
```

### PHP SDK

```php
$client = new \Naiuz\NeuronAI();

foreach ($client->voices->list(['type' => 'stock']) as $voice) {
    echo $voice->id, ' ', $voice->name, PHP_EOL;
}
```

### JavaScript

```javascript
let cursor = null;
const voices = [];

do {
    const query = cursor ? `type=stock&cursor=${cursor}` : 'type=stock';
    const response = await fetch(`https://my.neuronai.uz/api/v1/tts/voices?${query}`);
    const { data, next_cursor: nextCursor } = await response.json();

    voices.push(...data);  // each: { id, name, language, tags, type: 'stock' }
    cursor = nextCursor;
} while (cursor !== null);

console.log(voices);
```

### Python

```python
import requests

voices = []
cursor = None

while True:
    params = {"type": "stock", "cursor": cursor} if cursor else {"type": "stock"}
    response = requests.get("https://my.neuronai.uz/api/v1/tts/voices", params=params)
    response.raise_for_status()

    body = response.json()
    voices.extend(body["data"])  # each: { id, name, language, tags, type: 'stock' }

    cursor = body["next_cursor"]
    if cursor is None:
        break
```

### PHP

```php
$json = file_get_contents('https://my.neuronai.uz/api/v1/tts/voices?type=stock');
$voices = json_decode($json, true)['data'];  // each: ['id' => …, 'name' => …, 'language' => …, 'tags' => […], 'type' => 'stock']
```

---

Source: https://docs.neuronai.uz/api/reference/text-to-speech/list-voices
