> 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. # Create a voice POST https://api.elevenlabs.io/v1/text-to-voice Content-Type: application/json Create a voice from previously generated voice preview. This endpoint should be called after you fetched a generated_voice_id using POST /v1/text-to-voice/design or 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) — Name to use for the created voice. - `voice_description` (string, required) — Description to use for the created voice. - `generated_voice_id` (string, required) — The generated_voice_id to create; obtain it from POST /v1/text-to-voice/design, POST /v1/text-to-voice/:voice_id/remix, or the response headers when generating previews. - `labels` (map from string to string, optional, nullable) — Optional, metadata to add to the created voice. Defaults to None. - `played_not_selected_voice_ids` (list of string, optional, nullable) — List of voice ids that the user has played but not selected. Used for RLHF. ## Response ### 200 Successful Response - `voice_id` (string, required) — The ID of the voice. - `name` (string, optional) — The name of the voice. - `samples` (list of SampleResponseModel, optional, nullable) — List of samples associated with the voice. - `category` (enum, optional) — The category of the voice. - Allowed values: `generated`, `cloned`, `premade`, `professional`, `famous`, `high_quality` - `fine_tuning` (FineTuningResponseModel, optional, nullable) — Fine-tuning information for the voice. - `labels` (map from string to string, optional) — Labels associated with the voice. - `description` (string, optional, nullable) — The description of the voice. - `preview_url` (string, optional, nullable) — The preview URL of the voice. - `available_for_tiers` (list of string, optional) — The tiers the voice is available for. - `settings` (VoiceSettingsResponseModel, optional, nullable) — The settings of the voice. - `sharing` (VoiceSharingResponseModel, optional, nullable) — The sharing information of the voice. - `high_quality_base_model_ids` (list of string, optional) — The base model IDs for high-quality voices. - `verified_languages` (list of VerifiedVoiceLanguageResponseModel, optional, nullable) — The verified languages of the voice. - `collection_ids` (list of string, optional, nullable) — The IDs of collections this voice belongs to. - `safety_control` (enum, optional, nullable) — The safety controls of the voice. - Allowed values: `NONE`, `BAN`, `CAPTCHA`, `ENTERPRISE_BAN`, `ENTERPRISE_CAPTCHA` - `voice_verification` (VoiceVerificationResponseModel, optional, nullable) — The voice verification of the voice. - `permission_on_resource` (string, optional, nullable) — The permission on the resource of the voice. - `is_owner` (boolean, optional, nullable) — Whether the voice is owned by the user. - `is_legacy` (boolean, optional, default: false) — Whether the voice is legacy. - `is_mixed` (boolean, optional, default: false) — Whether the voice is mixed. - `favorited_at_unix` (integer, optional, nullable) — Timestamp when the voice was marked as favorite in Unix time. - `created_at_unix` (integer, optional, nullable) — The creation time of the voice in Unix time. - `is_bookmarked` (boolean, optional, nullable) — Whether the voice is bookmarked by the current user. Only relevant for community (library-copied) voices. - `recording_quality` (enum, optional, nullable) — The recording quality of the voice as determined by the review pipeline. - Allowed values: `studio`, `good`, `ok`, `poor`, `bad` - `labelling_status` (enum, optional, nullable) — The review pipeline status of the voice. - Allowed values: `in_review`, `review_complete` - `recording_quality_reason` (string, optional, nullable) — The reason for the recording quality assessment, as determined by the review pipeline. ## Errors ### 409 Conflict Error A generation for this preview is already in progress. Retry the request. - `any` ### 422 Unprocessable Entity Error Validation Error - `detail` (list of ValidationError, optional) ## Types ### SampleResponseModel - `sample_id` (string, optional) — The ID of the sample. - `file_name` (string, optional) — The name of the sample file. - `mime_type` (string, optional) — The MIME type of the sample file. - `size_bytes` (integer, optional) — The size of the sample file in bytes. - `hash` (string, optional) — The hash of the sample file. - `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) — Whether the user is allowed to fine-tune the voice. - `state` (map from string to enum, optional) — The state of the fine-tuning process for each model. - Allowed values: `not_started`, `queued`, `fine_tuning`, `fine_tuned`, `failed`, `delayed` - `verification_failures` (list of string, optional) — List of verification failures in the fine-tuning process. - `verification_attempts_count` (integer, optional) — The number of verification attempts in the fine-tuning process. - `manual_verification_requested` (boolean, optional) — Whether a manual verification was requested for the fine-tuning process. - `language` (string, optional, nullable) — The language of the fine-tuning process. - `progress` (map from string to double, optional, nullable) — The progress of the fine-tuning process. - `message` (map from string to string, optional, nullable) — The message of the fine-tuning process. - `dataset_duration_seconds` (double, optional, nullable) — The duration of the dataset in seconds. - `verification_attempts` (list of VerificationAttemptResponseModel, optional, nullable) — The number of verification attempts. - `slice_ids` (list of string, optional, nullable) — List of slice IDs. - `manual_verification` (ManualVerificationResponseModel, optional, nullable) — The manual verification of the fine-tuning process. - `max_verification_attempts` (integer, optional, nullable) — The maximum number of verification attempts. - `next_max_verification_attempts_reset_unix_ms` (integer, optional, nullable) — The next maximum verification attempts reset time in Unix milliseconds. - `finetuning_state` (any, optional) ### VoiceSettingsResponseModel - `stability` (double, optional, nullable, default: 0.5) — Determines how stable the voice is and the randomness between each generation. Lower values introduce broader emotional range for the voice. Higher values can result in a monotonous voice with limited emotion. - `use_speaker_boost` (boolean, optional, nullable, default: true) — This setting boosts the similarity to the original speaker. Using this setting requires a slightly higher computational load, which in turn increases latency. - `similarity_boost` (double, optional, nullable, default: 0.75) — Determines how closely the AI should adhere to the original voice when attempting to replicate it. - `style` (double, optional, nullable, default: 0) — Determines the style exaggeration of the voice. This setting attempts to amplify the style of the original speaker. It does consume additional computational resources and might increase latency if set to anything other than 0. - `speed` (double, optional, nullable, default: 1) — Adjusts the speed of the voice. A value of 1.0 is the default speed, while values less than 1.0 slow down the speech, and values greater than 1.0 speed it up. ### VoiceSharingResponseModel - `status` (enum, optional) — The status of the voice sharing. - Allowed values: `enabled`, `disabled`, `copied`, `copied_disabled` - `history_item_sample_id` (string, optional, nullable) — The sample ID of the history item. - `date_unix` (integer, optional) — The date of the voice sharing in Unix time. - `whitelisted_emails` (list of string, optional) — A list of whitelisted emails. - `public_owner_id` (string, optional) — The ID of the public owner. - `original_voice_id` (string, optional) — The ID of the original voice. - `financial_rewards_enabled` (boolean, optional) — Whether financial rewards are enabled. - `free_users_allowed` (boolean, optional) — Whether free users are allowed. - `live_moderation_enabled` (boolean, optional) — Whether live moderation is enabled. - `rate` (double, optional, nullable) — The rate of the voice sharing. - `fiat_rate` (double, optional, nullable) — The rate of the voice sharing in USD per 1000 credits. - `notice_period` (integer, optional) — The notice period of the voice sharing. - `disable_at_unix` (integer, optional, nullable) — The date of the voice sharing in Unix time. - `voice_mixing_allowed` (boolean, optional) — Whether voice mixing is allowed. - `featured` (boolean, optional) — Whether the voice is featured. - `category` (enum, optional) — The category of the voice. - Allowed values: `generated`, `cloned`, `premade`, `professional`, `famous`, `high_quality` - `reader_app_enabled` (boolean, optional, nullable) — Whether the reader app is enabled. - `image_url` (string, optional, nullable) — The image URL of the voice. - `ban_reason` (string, optional, nullable) — The ban reason of the voice. - `liked_by_count` (integer, optional) — The number of likes on the voice. - `cloned_by_count` (integer, optional) — The number of clones on the voice. - `name` (string, optional) — The name of the voice. - `description` (string, optional, nullable) — The description of the voice. - `labels` (map from string to string, optional) — The labels of the voice. - `review_status` (enum, optional) — The review status of the voice. - Allowed values: `not_requested`, `pending`, `declined`, `allowed`, `allowed_with_changes` - `review_message` (string, optional, nullable) — The review message of the voice. - `enabled_in_library` (boolean, optional) — Whether the voice is enabled in the library. - `instagram_username` (string, optional, nullable) — The Instagram username of the voice. - `twitter_username` (string, optional, nullable) — The Twitter/X username of the voice. - `youtube_username` (string, optional, nullable) — The YouTube username of the voice. - `tiktok_username` (string, optional, nullable) — The TikTok username of the voice. - `moderation_check` (VoiceSharingModerationCheckResponseModel, optional, nullable) — The moderation check of the voice. - `reader_restricted_on` (list of ReaderResourceResponseModel, optional, nullable) — The reader restricted on of the voice. ### VerifiedVoiceLanguageResponseModel - `language` (string, required) — The language of the voice. - `model_id` (string, required) — The voice's model ID. - `accent` (string, optional, nullable) — The voice's accent, if applicable. - `locale` (string, optional, nullable) — The voice's locale, if applicable. - `preview_url` (string, optional, nullable) — The voice's preview URL, if applicable. ### VoiceVerificationResponseModel - `requires_verification` (boolean, required) — Whether the voice requires verification. - `is_verified` (boolean, required) — Whether the voice has been verified. - `verification_failures` (list of string, required) — List of verification failures. - `verification_attempts_count` (integer, required) — The number of verification attempts. - `language` (string, optional, nullable) — The language of the voice. - `verification_attempts` (list of VerificationAttemptResponseModel, optional, nullable) — Number of times a verification was attempted. ### ValidationError - `loc` (list of ValidationErrorLocItems, required) - `msg` (string, required) - `type` (string, required) ### SpeakerSeparationResponseModel - `voice_id` (string, required) — The ID of the voice. - `sample_id` (string, required) — The ID of the sample. - `status` (enum, required) — The status of the speaker separation. - Allowed values: `not_started`, `pending`, `completed`, `failed` - `speakers` (map from string to SpeakerResponseModel, optional, nullable) — The speakers of the sample. - `selected_speaker_ids` (list of string, optional, nullable) — The IDs of the selected speakers. ### VerificationAttemptResponseModel - `text` (string, required) — The text of the verification attempt. - `date_unix` (integer, required) — The date of the verification attempt in Unix time. - `accepted` (boolean, required) — Whether the verification attempt was accepted. - `similarity` (double, required) — The similarity of the verification attempt. - `levenshtein_distance` (double, required) — The Levenshtein distance of the verification attempt. - `recording` (RecordingResponseModel, optional, nullable) — The recording of the verification attempt. ### ManualVerificationResponseModel - `extra_text` (string, required) — The extra text of the manual verification. - `request_time_unix` (integer, required) — The date of the manual verification in Unix time. - `files` (list of ManualVerificationFileResponseModel, required) — The files of the manual verification. ### VoiceSharingModerationCheckResponseModel - `date_checked_unix` (integer, optional, nullable) — The date the moderation check was made in Unix time. - `name_value` (string, optional, nullable) — The name value of the voice. - `name_check` (boolean, optional, nullable) — Whether the name check was successful. - `description_value` (string, optional, nullable) — The description value of the voice. - `description_check` (boolean, optional, nullable) — Whether the description check was successful. - `sample_ids` (list of string, optional, nullable) — A list of sample IDs. - `sample_checks` (list of double, optional, nullable) — A list of sample checks. - `captcha_ids` (list of string, optional, nullable) — A list of captcha IDs. - `captcha_checks` (list of double, optional, nullable) — A list of CAPTCHA check values. ### ReaderResourceResponseModel - `resource_type` (enum, required) — The type of resource. - Allowed values: `read`, `collection` - `resource_id` (string, required) — The ID of the resource. ### ValidationErrorLocItems ### SpeakerResponseModel - `speaker_id` (string, required) — The ID of the speaker. - `duration_secs` (double, required) — The duration of the speaker segment in seconds. - `utterances` (list of UtteranceResponseModel, optional, nullable) — The utterances of the speaker. ### RecordingResponseModel - `recording_id` (string, required) — The ID of the recording. - `mime_type` (string, required) — The MIME type of the recording. - `size_bytes` (integer, required) — The size of the recording in bytes. - `upload_date_unix` (integer, required) — The date of the recording in Unix time. - `transcription` (string, required) — The transcription of the recording. ### ManualVerificationFileResponseModel - `file_id` (string, required) — The ID of the file. - `file_name` (string, required) — The name of the file. - `mime_type` (string, required) — The MIME type of the file. - `size_bytes` (integer, required) — The size of the file in bytes. - `upload_date_unix` (integer, required) — The date of the file in Unix time. ### UtteranceResponseModel - `start` (double, required) — The start time of the utterance in seconds. - `end` (double, required) — The end time of the utterance in seconds. ## 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 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 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() ``` > ElevenLabs provides APIs and SDKs for text to speech, voice cloning, speech to text, sound effects, voice isolator, voice changer, and conversational AI agents. Build voice-enabled applications with lifelike audio generation.