> This is a page from the ElevenLabs documentation. For a complete page index, fetch https://elevenlabs.io/docs/llms.txt. For the full documentation in a single file, fetch https://elevenlabs.io/docs/llms-full.txt.

# Utwórz nowy głos z podglądu głosu

POST https://api.elevenlabs.io/v1/text-to-voice
Content-Type: application/json

Utwórz głos z wcześniej wygenerowanego podglądu głosu. Ten endpoint należy wywołać po pobraniu generated_voice_id za pomocą POST /v1/text-to-voice/design lub POST /v1/text-to-voice/:voice_id/remix.

Reference: https://elevenlabs.io/docs/api-reference/text-to-voice/create

## Servers

- `https://api.elevenlabs.io` (Production, default)
- `https://api.us.elevenlabs.io` (Production US)
- `https://api.eu.residency.elevenlabs.io` (Production EU)
- `https://api.in.residency.elevenlabs.io` (Production India)
- `https://api.sg.residency.elevenlabs.io` (Production Singapore)

## Request

### Body (application/json)

This endpoint expects a Body_Create_a_new_voice_from_voice_preview_v1_text_to_voice_post.

- `voice_name` (string, required) — Nazwa dla utworzonego głosu.
- `voice_description` (string, required) — Opis dla utworzonego głosu.
- `generated_voice_id` (string, required) — generated_voice_id do utworzenia; uzyskaj go z POST /v1/text-to-voice/design, POST /v1/text-to-voice/:voice_id/remix lub nagłówków odpowiedzi podczas generowania podglądów.
- `labels` (map from string to string, optional, nullable) — Opcjonalne metadane do dodania do utworzonego głosu. Domyślnie None.
- `played_not_selected_voice_ids` (list of string, optional, nullable) — Lista ID głosów odtworzonych, ale niewybranych przez użytkownika. Używane przez RLHF.

## Response

### 200

Pomyślna odpowiedź

- `voice_id` (string, required) — ID głosu.
- `name` (string, optional) — Nazwa głosu.
- `samples` (list of SampleResponseModel, optional, nullable) — Lista próbek powiązanych z głosem.
- `category` (enum, optional) — Kategoria głosu.
  - Allowed values: `generated`, `cloned`, `premade`, `professional`, `famous`, `high_quality`
- `fine_tuning` (FineTuningResponseModel, optional, nullable) — Informacje o dostrajaniu głosu.
- `labels` (map from string to string, optional) — Etykiety powiązane z głosem.
- `description` (string, optional, nullable) — Opis głosu.
- `preview_url` (string, optional, nullable) — Adres URL podglądu głosu.
- `available_for_tiers` (list of string, optional) — Poziomy, dla których głos jest dostępny.
- `settings` (VoiceSettingsResponseModel, optional, nullable) — Ustawienia głosu.
- `sharing` (VoiceSharingResponseModel, optional, nullable) — Informacje o udostępnianiu głosu.
- `high_quality_base_model_ids` (list of string, optional) — Identyfikatory modeli bazowych dla głosów wysokiej jakości.
- `verified_languages` (list of VerifiedVoiceLanguageResponseModel, optional, nullable) — Zweryfikowane języki głosu.
- `collection_ids` (list of string, optional, nullable) — ID kolekcji, do których należy ten głos.
- `safety_control` (enum, optional, nullable) — Kontrole zabezpieczeń głosu.
  - Allowed values: `NONE`, `BAN`, `CAPTCHA`, `ENTERPRISE_BAN`, `ENTERPRISE_CAPTCHA`
- `voice_verification` (VoiceVerificationResponseModel, optional, nullable) — Weryfikacja głosu.
- `permission_on_resource` (string, optional, nullable) — Uprawnienie do zasobu głosu.
- `is_owner` (boolean, optional, nullable) — Czy głos należy do użytkownika.
- `is_legacy` (boolean, optional, default: false) — Czy głos jest starszego typu.
- `is_mixed` (boolean, optional, default: false) — Czy głos jest zmiksowany.
- `favorited_at_unix` (integer, optional, nullable) — Znacznik czasu Unix, gdy głos oznaczono jako ulubiony.
- `created_at_unix` (integer, optional, nullable) — Czas utworzenia głosu w czasie Unix.
- `is_bookmarked` (boolean, optional, nullable) — Czy bieżący użytkownik dodał głos do zakładek. Dotyczy tylko głosów społecznościowych (skopiowanych z biblioteki).
- `recording_quality` (enum, optional, nullable) — Jakość nagrania głosu określona przez proces weryfikacji.
  - Allowed values: `studio`, `good`, `ok`, `poor`, `bad`
- `labelling_status` (enum, optional, nullable) — Status procesu weryfikacji głosu.
  - Allowed values: `in_review`, `review_complete`
- `recording_quality_reason` (string, optional, nullable) — Powód oceny jakości nagrania, określony przez proces weryfikacji.

## Errors

### 409 Conflict Error

Generowanie tego podglądu już trwa. Spróbuj ponownie.

- `any`

### 422 Unprocessable Entity Error

Błąd walidacji

- `detail` (list of ValidationError, optional)

## Types

### SampleResponseModel

- `sample_id` (string, optional) — ID próbki.
- `file_name` (string, optional) — Nazwa pliku próbki.
- `mime_type` (string, optional) — Typ MIME pliku próbki.
- `size_bytes` (integer, optional) — Rozmiar pliku próbki w bajtach.
- `hash` (string, optional) — Hash pliku próbki.
- `duration_secs` (double, optional, nullable)
- `remove_background_noise` (boolean, optional, nullable)
- `has_isolated_audio` (boolean, optional, nullable)
- `has_isolated_audio_preview` (boolean, optional, nullable)
- `speaker_separation` (SpeakerSeparationResponseModel, optional, nullable)
- `trim_start` (integer, optional, nullable)
- `trim_end` (integer, optional, nullable)

### FineTuningResponseModel

- `is_allowed_to_fine_tune` (boolean, optional) — Czy użytkownik może dostrajać głos.
- `state` (map from string to enum, optional) — Stan procesu Finetune dla każdego modelu.
  - Allowed values: `not_started`, `queued`, `fine_tuning`, `fine_tuned`, `failed`, `delayed`
- `verification_failures` (list of string, optional) — Lista błędów weryfikacji w procesie finetune.
- `verification_attempts_count` (integer, optional) — Liczba prób weryfikacji w procesie Finetune.
- `manual_verification_requested` (boolean, optional) — Czy zażądano ręcznej weryfikacji procesu fine-tuningu.
- `language` (string, optional, nullable) — Język procesu Finetune.
- `progress` (map from string to double, optional, nullable) — Postęp procesu Finetune.
- `message` (map from string to string, optional, nullable) — Komunikat procesu Finetune.
- `dataset_duration_seconds` (double, optional, nullable) — Czas trwania zbioru danych w sekundach.
- `verification_attempts` (list of VerificationAttemptResponseModel, optional, nullable) — Liczba prób weryfikacji.
- `slice_ids` (list of string, optional, nullable) — Lista ID segmentów.
- `manual_verification` (ManualVerificationResponseModel, optional, nullable) — Ręczna weryfikacja procesu Finetune.
- `max_verification_attempts` (integer, optional, nullable) — Maksymalna liczba prób weryfikacji.
- `next_max_verification_attempts_reset_unix_ms` (integer, optional, nullable) — Czas resetowania maksymalnej liczby prób weryfikacji, w milisekundach Unix.
- `finetuning_state` (any, optional)

### VoiceSettingsResponseModel

- `stability` (double, optional, nullable, default: 0.5) — Określa stabilność głosu i losowość między kolejnymi generacjami. Niższe wartości zapewniają głosowi szerszy zakres emocji. Wyższe wartości mogą dać monotonny głos z ograniczonymi emocjami.
- `use_speaker_boost` (boolean, optional, nullable, default: true) — To ustawienie zwiększa podobieństwo do oryginalnego mówcy. Wymaga nieco większej mocy obliczeniowej, co z kolei zwiększa opóźnienie.
- `similarity_boost` (double, optional, nullable, default: 0.75) — Określa, jak dokładnie AI ma trzymać się oryginalnego głosu podczas próby jego odtworzenia.
- `style` (double, optional, nullable, default: 0) — Określa stopień wyrazistości stylu głosu. To ustawienie wzmacnia styl oryginalnego mówcy. Zużywa dodatkowe zasoby obliczeniowe i może zwiększyć opóźnienie, jeśli ma wartość inną niż 0.
- `speed` (double, optional, nullable, default: 1) — Dostosowuje szybkość głosu. Wartość 1.0 oznacza domyślną szybkość, wartości mniejsze niż 1.0 spowalniają mowę, a większe niż 1.0 ją przyspieszają.
- `clone_strength` (double, optional, nullable) — Określa, jak dobrze głos pasuje do próbek profesjonalnego klonu głosu — od 0 (nisko) do 1 (wysoko). W większości przypadków zalecamy wartość 0. Zwiększ ją tylko, jeśli występują problemy z domyślnymi ustawieniami. Dotyczy tylko profesjonalnych klonów głosu dostrojonych do wybranego modelu v4.

### VoiceSharingResponseModel

- `status` (enum, optional) — Status udostępniania głosu.
  - Allowed values: `enabled`, `disabled`, `copied`, `copied_disabled`
- `history_item_sample_id` (string, optional, nullable) — ID próbki elementu historii.
- `date_unix` (integer, optional) — Data udostępnienia głosu w czasie Unix.
- `whitelisted_emails` (list of string, optional) — Lista e-maili na liście dozwolonych.
- `public_owner_id` (string, optional) — ID publicznego właściciela.
- `original_voice_id` (string, optional) — ID oryginalnego głosu.
- `financial_rewards_enabled` (boolean, optional) — Czy nagrody finansowe są włączone.
- `free_users_allowed` (boolean, optional) — Czy bezpłatni użytkownicy są dozwoleni.
- `live_moderation_enabled` (boolean, optional) — Czy moderacja na żywo jest włączona.
- `rate` (double, optional, nullable) — Stawka udostępnienia głosu.
- `fiat_rate` (double, optional, nullable) — Stawka udostępnienia głosu w USD za 1000 kredytów.
- `notice_period` (integer, optional) — Okres wypowiedzenia udostępnienia głosu.
- `disable_at_unix` (integer, optional, nullable) — Data udostępnienia głosu w czasie Unix.
- `voice_mixing_allowed` (boolean, optional) — Czy miksowanie głosów jest dozwolone.
- `featured` (boolean, optional) — Czy głos jest wyróżniony.
- `category` (enum, optional) — Kategoria głosu.
  - Allowed values: `generated`, `cloned`, `premade`, `professional`, `famous`, `high_quality`
- `reader_app_enabled` (boolean, optional, nullable) — Czy aplikacja Reader jest włączona.
- `image_url` (string, optional, nullable) — Adres URL obrazu głosu.
- `ban_reason` (string, optional, nullable) — Powód zablokowania głosu.
- `liked_by_count` (integer, optional) — Liczba polubień głosu.
- `cloned_by_count` (integer, optional) — Liczba klonów głosu.
- `name` (string, optional) — Nazwa głosu.
- `description` (string, optional, nullable) — Opis głosu.
- `labels` (map from string to string, optional) — Etykiety głosu.
- `review_status` (enum, optional) — Status weryfikacji głosu.
  - Allowed values: `not_requested`, `pending`, `declined`, `declined_resubmittable`, `allowed`, `allowed_with_changes`
- `review_message` (string, optional, nullable) — Wiadomość z weryfikacji głosu.
- `enabled_in_library` (boolean, optional) — Czy głos jest włączony w bibliotece.
- `instagram_username` (string, optional, nullable) — Nazwa użytkownika głosu na Instagramie.
- `twitter_username` (string, optional, nullable) — Nazwa użytkownika głosu na Twitterze/X.
- `youtube_username` (string, optional, nullable) — Nazwa użytkownika głosu na YouTube.
- `tiktok_username` (string, optional, nullable) — Nazwa użytkownika głosu na TikToku.
- `moderation_check` (VoiceSharingModerationCheckResponseModel, optional, nullable) — Kontrola moderacji głosu.
- `reader_restricted_on` (list of ReaderResourceResponseModel, optional, nullable) — Ograniczenie głosu w Reader.

### VerifiedVoiceLanguageResponseModel

- `language` (string, required) — Język głosu.
- `model_id` (string, required) — ID modelu głosu.
- `accent` (string, optional, nullable) — Akcent głosu, jeśli dotyczy.
- `locale` (string, optional, nullable) — Ustawienia regionalne głosu, jeśli dotyczy.
- `preview_url` (string, optional, nullable) — URL podglądu głosu, jeśli dotyczy.

### VoiceVerificationResponseModel

- `requires_verification` (boolean, required) — Czy głos wymaga weryfikacji.
- `is_verified` (boolean, required) — Czy głos został zweryfikowany.
- `verification_failures` (list of string, required) — Lista błędów weryfikacji.
- `verification_attempts_count` (integer, required) — Liczba prób weryfikacji.
- `language` (string, optional, nullable) — Język głosu.
- `verification_attempts` (list of VerificationAttemptResponseModel, optional, nullable) — Liczba prób weryfikacji.

### ValidationError

- `loc` (list of ValidationErrorLocItems, required)
- `msg` (string, required)
- `type` (string, required)

### SpeakerSeparationResponseModel

- `voice_id` (string, required) — ID głosu.
- `sample_id` (string, required) — ID próbki.
- `status` (enum, required) — Status rozdzielania mówców.
  - Allowed values: `not_started`, `pending`, `completed`, `failed`
- `speakers` (map from string to SpeakerResponseModel, optional, nullable) — Mówcy w próbce.
- `selected_speaker_ids` (list of string, optional, nullable) — ID wybranych mówców.

### VerificationAttemptResponseModel

- `text` (string, required) — Tekst próby weryfikacji.
- `date_unix` (integer, required) — Data próby weryfikacji w czasie Unix.
- `accepted` (boolean, required) — Czy próba weryfikacji została zaakceptowana.
- `similarity` (double, required) — Podobieństwo próby weryfikacji.
- `levenshtein_distance` (double, required) — Odległość Levenshteina próby weryfikacji.
- `recording` (RecordingResponseModel, optional, nullable) — Nagranie próby weryfikacji.

### ManualVerificationResponseModel

- `extra_text` (string, required) — Dodatkowy tekst ręcznej weryfikacji.
- `request_time_unix` (integer, required) — Data ręcznej weryfikacji w czasie Unix.
- `files` (list of ManualVerificationFileResponseModel, required) — Pliki do ręcznej weryfikacji.

### VoiceSharingModerationCheckResponseModel

- `date_checked_unix` (integer, optional, nullable) — Data przeprowadzenia kontroli moderacji w czasie Unix.
- `name_value` (string, optional, nullable) — Wartość nazwy głosu.
- `name_check` (boolean, optional, nullable) — Czy sprawdzenie nazwy zakończyło się powodzeniem.
- `description_value` (string, optional, nullable) — Wartość opisu głosu.
- `description_check` (boolean, optional, nullable) — Czy sprawdzenie opisu zakończyło się powodzeniem.
- `sample_ids` (list of string, optional, nullable) — Lista identyfikatorów próbek.
- `sample_checks` (list of double, optional, nullable) — Lista kontroli próbek.
- `captcha_ids` (list of string, optional, nullable) — Lista identyfikatorów CAPTCHA.
- `captcha_checks` (list of double, optional, nullable) — Lista wartości kontroli CAPTCHA.

### ReaderResourceResponseModel

- `resource_type` (enum, required) — Typ zasobu.
  - Allowed values: `read`, `collection`
- `resource_id` (string, required) — ID zasobu.

### ValidationErrorLocItems

- string
- integer

### SpeakerResponseModel

- `speaker_id` (string, required) — ID mówcy.
- `duration_secs` (double, required) — Czas trwania segmentu mówcy w sekundach.
- `utterances` (list of UtteranceResponseModel, optional, nullable) — Wypowiedzi mówcy.

### RecordingResponseModel

- `recording_id` (string, required) — ID nagrania.
- `mime_type` (string, required) — Typ MIME nagrania.
- `size_bytes` (integer, required) — Rozmiar nagrania w bajtach.
- `upload_date_unix` (integer, required) — Data nagrania w czasie Unix.
- `transcription` (string, required) — Transkrypcja nagrania.

### ManualVerificationFileResponseModel

- `file_id` (string, required) — ID pliku.
- `file_name` (string, required) — Nazwa pliku.
- `mime_type` (string, required) — Typ MIME pliku.
- `size_bytes` (integer, required) — Rozmiar pliku w bajtach.
- `upload_date_unix` (integer, required) — Data pliku w czasie Unix.

### UtteranceResponseModel

- `start` (double, required) — Czas rozpoczęcia wypowiedzi w sekundach.
- `end` (double, required) — Czas zakończenia wypowiedzi w sekundach.

## Examples

**Request**

```json
{
  "voice_name": "Sassy squeaky mouse",
  "voice_description": "A sassy squeaky mouse",
  "generated_voice_id": "37HceQefKmEi3bGovXjL"
}
```

**Response**

```json
{
  "voice_id": "21m00Tcm4TlvDq8ikWAM",
  "name": "Rachel",
  "category": "professional",
  "fine_tuning": {
    "is_allowed_to_fine_tune": true,
    "state": {
      "eleven_multilingual_v2": "fine_tuned"
    },
    "verification_failures": [],
    "verification_attempts_count": 2,
    "manual_verification_requested": false
  },
  "labels": {
    "accent": "American",
    "age": "middle-aged",
    "description": "expressive",
    "gender": "female",
    "use_case": "social media"
  },
  "description": "A warm, expressive voice with a touch of humor.",
  "preview_url": "https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3",
  "available_for_tiers": [
    "creator",
    "enterprise"
  ],
  "settings": {
    "stability": 1,
    "use_speaker_boost": true,
    "similarity_boost": 1,
    "style": 0,
    "speed": 1
  },
  "sharing": {
    "status": "enabled",
    "history_item_sample_id": "DCwhRBWXzGAHq8TQ4Fs18",
    "date_unix": 1714204800,
    "whitelisted_emails": [
      "example@example.com"
    ],
    "public_owner_id": "DCwhRBWXzGAHq8TQ4Fs18",
    "original_voice_id": "DCwhRBWXzGAHq8TQ4Fs18",
    "financial_rewards_enabled": true,
    "free_users_allowed": true,
    "live_moderation_enabled": true,
    "rate": 0.05,
    "notice_period": 30,
    "disable_at_unix": 1714204800,
    "voice_mixing_allowed": false,
    "featured": true,
    "category": "professional",
    "reader_app_enabled": true,
    "liked_by_count": 100,
    "cloned_by_count": 50,
    "name": "Rachel",
    "description": "A female voice with a soft and friendly tone.",
    "labels": {
      "accent": "American",
      "gender": "female"
    },
    "review_status": "allowed",
    "enabled_in_library": true,
    "moderation_check": {
      "date_checked_unix": 1714204800,
      "name_value": "Rachel",
      "name_check": true,
      "description_value": "A female voice with a soft and friendly tone.",
      "description_check": true,
      "sample_ids": [
        "sample1",
        "sample2"
      ],
      "sample_checks": [
        0.95,
        0.98
      ],
      "captcha_ids": [
        "captcha1",
        "captcha2"
      ],
      "captcha_checks": [
        0.95,
        0.98
      ]
    },
    "reader_restricted_on": [
      {
        "resource_type": "read",
        "resource_id": "FCwhRBWXzGAHq8TQ4Fs18"
      }
    ]
  },
  "high_quality_base_model_ids": [
    "eleven_v2_flash",
    "eleven_flash_v2",
    "eleven_turbo_v2_5",
    "eleven_multilingual_v2",
    "eleven_v2_5_flash",
    "eleven_flash_v2_5",
    "eleven_turbo_v2"
  ],
  "verified_languages": [
    {
      "language": "en",
      "model_id": "eleven_multilingual_v2",
      "accent": "american",
      "locale": "en-US",
      "preview_url": "https://storage.googleapis.com/eleven-public-prod/premade/voices/9BWtsMINqrJLrRacOk9x/405766b8-1f4e-4d3c-aba1-6f25333823ec.mp3"
    }
  ],
  "voice_verification": {
    "requires_verification": false,
    "is_verified": true,
    "verification_failures": [],
    "verification_attempts_count": 0,
    "language": "en",
    "verification_attempts": [
      {
        "text": "Hello, how are you?",
        "date_unix": 1714204800,
        "accepted": true,
        "similarity": 0.95,
        "levenshtein_distance": 2,
        "recording": {
          "recording_id": "CwhRBWXzGAHq8TQ4Fs17",
          "mime_type": "audio/mpeg",
          "size_bytes": 1000000,
          "upload_date_unix": 1714204800,
          "transcription": "Hello, how are you?"
        }
      }
    ]
  },
  "is_owner": false,
  "is_legacy": false,
  "is_mixed": false
}
```

**SDK Code**

```python
import requests

url = "https://api.elevenlabs.io/v1/text-to-voice"

payload = {
    "voice_name": "Sassy squeaky mouse",
    "voice_description": "A sassy squeaky mouse",
    "generated_voice_id": "37HceQefKmEi3bGovXjL"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.elevenlabs.io/v1/text-to-voice';
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: '{"voice_name":"Sassy squeaky mouse","voice_description":"A sassy squeaky mouse","generated_voice_id":"37HceQefKmEi3bGovXjL"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.elevenlabs.io/v1/text-to-voice"

	payload := strings.NewReader("{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.elevenlabs.io/v1/text-to-voice")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.elevenlabs.io/v1/text-to-voice")
  .header("Content-Type", "application/json")
  .body("{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.elevenlabs.io/v1/text-to-voice', [
  'body' => '{
  "voice_name": "Sassy squeaky mouse",
  "voice_description": "A sassy squeaky mouse",
  "generated_voice_id": "37HceQefKmEi3bGovXjL"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.elevenlabs.io/v1/text-to-voice");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"voice_name\": \"Sassy squeaky mouse\",\n  \"voice_description\": \"A sassy squeaky mouse\",\n  \"generated_voice_id\": \"37HceQefKmEi3bGovXjL\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = [
  "voice_name": "Sassy squeaky mouse",
  "voice_description": "A sassy squeaky mouse",
  "generated_voice_id": "37HceQefKmEi3bGovXjL"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.elevenlabs.io/v1/text-to-voice")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```