{"openapi":"3.0.0","info":{"description":"Text-to-speech service with high-quality AI voices and voice cloning capabilities"},"servers":[{"description":"Text-to-speech service with high-quality AI voices and voice cloning capabilities","url":"https://api.apirails.com/playht"}],"paths":{"/api/v2/tts":{"post":{"tags":["Text To Speech"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.play.ht/reference/api-generate-audio","api_endpoint":"https://api.play.ht/api/v2/tts"},"summary":"Generate Audio From Text","description":"Creates a new Text-to-Speech (TTS) job that converts input text into audio asynchronously.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"The text to be converted to speech. (Defaults to Hello from a realistic voice.)","required":true},"emotion":{"type":"enum","description":"An emotion to be applied to the speech. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engin","enum":["female_happy","female_sad","female_angry","female_fearful","female_disgust","female_surprised","male_happy","male_sad","male_angry","male_fearful","male_disgust","male_surprised"]},"output_format":{"type":"enum","description":"The format for the output audio. Note that PlayHT1.0 engine voices and JSON output format only support 'mp3' and 'mulaw. (Defaults to mp3)","enum":["mp3","mulaw","wav","ogg","flac"]},"quality":{"type":"enum","description":"The quality for the audio","enum":["draft","low","medium","high","premium"]},"sample_rate":{"type":"number","description":"A number greater than or equal to 8000, and must be less than or equal to 48000"},"seed":{"type":"number","description":"An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file."},"speed":{"type":"number","description":"Control how fast the generated audio should be. A number greater than 0 and less than or equal to 5.0"},"style_guidance":{"type":"number","description":"A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engine."},"temperature":{"type":"number","description":"A floating point number between 0, inclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice."},"voice":{"type":"string","description":"The unique ID for a PlayHT or Cloned Voice. (Defaults to s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json)","required":true},"voice_engine":{"type":"enum","description":"The voice engine used to synthesize the voice.","enum":["PlayHT2.0-turbo","PlayHT2.0","PlayHT1.0"]},"voice_guidance":{"type":"number","description":"A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices. Higher numbers will maximize its individuality. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engine."}}},"example":{"text":"","emotion":"","output_format":"","quality":"","sample_rate":"","seed":"","speed":"","style_guidance":"","temperature":"","voice":"","voice_engine":"","voice_guidance":""}}}}}},"/api/v2/tts/stream":{"post":{"tags":["Streaming"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.play.ht/reference/api-generate-tts-audio-stream","api_endpoint":"https://api.play.ht/api/v2/tts/stream"},"summary":"Stream Audio From Text","description":"Streams the audio bytes immediately or returns a URL that allows immediate streaming","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{"text":{"type":"string","description":"The text to be converted to speech. (Defaults to Hello from a realistic voice.)","required":true},"emotion":{"type":"enum","description":"An emotion to be applied to the speech. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engin","enum":["female_happy","female_sad","female_angry","female_fearful","female_disgust","female_surprised","male_happy","male_sad","male_angry","male_fearful","male_disgust","male_surprised"]},"output_format":{"type":"enum","description":"The format for the output audio. Note that PlayHT1.0 engine voices and JSON output format only support 'mp3' and 'mulaw. (Defaults to mp3)","enum":["mp3","mulaw","wav","ogg","flac"]},"quality":{"type":"enum","description":"The quality for the audio","enum":["draft","low","medium","high","premium"]},"sample_rate":{"type":"number","description":"A number greater than or equal to 8000, and must be less than or equal to 48000"},"seed":{"type":"number","description":"An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file."},"speed":{"type":"number","description":"Control how fast the generated audio should be. A number greater than 0 and less than or equal to 5.0"},"style_guidance":{"type":"number","description":"A number between 1 and 30. Use lower numbers to to reduce how strong your chosen emotion will be. Higher numbers will create a very emotional performance. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engine."},"temperature":{"type":"number","description":"A floating point number between 0, inclusive, and 2, inclusive. If equal to null or not provided, the model's default temperature will be used. The temperature parameter controls variance. Lower temperatures result in more predictable results, higher temperatures allow each run to vary more, so the voice may sound less like the baseline voice."},"text_guidance":{"type":"number","description":"A number between 1 and 2. This number influences how closely the generated speech adheres to the input text. Use lower values to create more fluid speech, but with a higher chance of deviating from the input text. Higher numbers will make the generated speech more accurate to the input text, ensuring that the words spoken align closely with the provided text. Only supported when voice_engine is set to PlayHT2.0, and voice uses that engine."},"voice":{"type":"string","description":"The unique ID for a PlayHT or Cloned Voice. (Defaults to s3://voice-cloning-zero-shot/d9ff78ba-d016-47f6-b0ef-dd630f59414e/female-cs/manifest.json)","required":true},"voice_engine":{"type":"enum","description":"The voice engine used to synthesize the voice.","enum":["PlayHT2.0-turbo","PlayHT2.0","PlayHT1.0"]},"voice_guidance":{"type":"number","description":"A number between 1 and 6. Use lower numbers to reduce how unique your chosen voice will be compared to other voices. Higher numbers will maximize its individuality. Only supported when voice_engine is set to PlayHT2.0 or PlayHT2.0-turbo, and voice uses that engine."}}},"example":{"text":"","emotion":"","output_format":"","quality":"","sample_rate":"","seed":"","speed":"","style_guidance":"","temperature":"","text_guidance":"","voice":"","voice_engine":"","voice_guidance":""}}}}}},"/api/v2/tts/{id}":{"get":{"tags":["Text To Speech"],"parameters":[{"name":"id","in":"path","description":"The job ID","required":true,"schema":{"type":"string","example":""}},{"name":"format","in":"query","description":"The format query is an optional convenience parameter that allows controlling the response format without having to set the accept header. If used, the format query param overrides what is set by the accept header. If format is omitted, the accept header is used to determine the response format.","schema":{"type":"enum","example":"","items":{"type":"string","enum":["audio-mpeg","event-stream"]}}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.play.ht/reference/api-get-tts-data","api_endpoint":"https://api.play.ht/api/v2/tts/{id}"},"summary":"Get Text-To-Speech Job Data","description":"Retrieves information about an async text-to-speech job.","security":[{"bearerAuth":[]}]}},"/api/v2/cloned-voices":{"get":{"tags":["Voice Cloning"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.play.ht/reference/api-list-cloned-voices","api_endpoint":"https://api.play.ht/api/v2/cloned-voices"},"summary":"List Cloned Voices","description":"To generate audio with your cloned voice, use the id returned by this endpoint as the voice parameter in the Generate Audio endpoint or the Stream Audio endpoint.\n\nThe id of a cloned voice will look like a url, for example: s3://mockingbird-prod/william_3_d2b62fd7-a52d-4bd1-a09a-fb2748eda979/voices/william_3/manifest.json.\n","security":[{"bearerAuth":[]}]},"delete":{"tags":["Voice Cloning"],"parameters":[{"name":"voice_id","in":"path","description":"The ID of the cloned voice to be deleted.","required":true,"schema":{"type":"string","example":""}}],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.play.ht/reference/api-delete-cloned-voices","api_endpoint":"https://api.play.ht/api/v2/cloned-voices"},"summary":"Delete Cloned Voices","description":"Deletes a cloned voice created by the user using the provided voice_id.\n","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","required":[],"properties":{}},"example":{}}}}}},"/api/v2/cloned-voices/instant":{"post":{"tags":["Voice Cloning"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.play.ht/reference/api-create-instant-voice-clone","api_endpoint":"https://api.play.ht/api/v2/cloned-voices/instant"},"summary":"Create Instant Voice Clone","description":"Create an instant voice clone by providing a sample audio file via file upload.\n\nThe cloned voice will be based on the characteristics of the provided audio\nfile. Upload the file using multipart/form-data and include the sample file. The created\nvoice clone can be used for text-to-speech (TTS) generation.\n\nThe audio file selected as the source for the voice clone should have a\nduration ranging from 2 seconds to 1 hour. It can be in any audio\nformat, as long as it falls within the size range of 5kb to 50MB.","security":[{"bearerAuth":[]}],"requestBody":{"description":"","required":false,"content":{"multipart/form-data":{"schema":{"type":"object","required":[],"properties":{"sample_file":{"type":"string","format":"binary","description":"The audio file selected as the source for the voice clone should have a duration ranging from 2 seconds to 1 hour. It can be in any audio format, as long as it falls within the size range of 5kb to 50 MB"},"sample_file_url":{"type":"string","description":"The URL of the audio file selected as the source for the voice clone. The file should have a duration ranging from 2 seconds to 1 hour. It can be in any audio format, as long as it falls within the size range of 5kb to 50 MB"},"voice_name":{"type":"string","description":"The name for this new cloned voice"}}},"example":{"sample_file":"(binary)","sample_file_url":"","voice_name":""}}}}}},"/api/v2/voices":{"get":{"tags":["Voices"],"parameters":[],"responses":{"401":{"description":"Bearer token required (Authorization header)","content":{"application/json":{}}}},"externalDocs":{"api_ref":"https://docs.play.ht/reference/api-list-ultra-realistic-voices","api_endpoint":"https://api.play.ht/api/v2/voices"},"summary":"List PlayHT Voices","description":"Gets the full list of stock PlayHT Voices available for use with the API.","security":[{"bearerAuth":[]}]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer"}}},"security":[{"bearerAuth":[]}]}