Convert Text to Speech

750 atoms
Base tier


This Utility API converts text to speech in multiple languages. It detects the language of your text automatically.
You can input text directly, or provide a file or URL, and the utility will extract and convert the text for you. This is great for handling long documents or web pages without extra steps of copying or pasting text.
This API can be applied and used in accessibility features, aiding individuals with visual impairments by providing an auditory representation of written text, audiobooks, navigation systems, language learning apps, and virtual assistants. Content creators and marketers leverage text-to-speech to enhance engagement by offering audio versions of written content, making information more accessible and convenient for diverse audiences.
Endpoint Selector

API Playground


Convert File to Speech File

Request example

curl --location --request POST 'https://api.apyhub.com/tts/file' \
--header 'apy-token: {{token}}' \
--form 'file=@"sample.pdf"' \
--form 'gender="female"'
Method: POST
Content Type: multipart/form-data
Request Body
fileFileYesThe source file that you want to convert to speech. Supported file formats are pdf, doc, docx, png, jpg, jpeg, bmp, tiff, xlsx, pptx, html, and xml
genderStringYesThe voice you want for your speech. Accepts male and female.
Sample Response
A successful request returns the audio file. If the request fails, the response contains an error code and a message to help determine what went wrong.

HTTP Response Codes

The method may return one of the following HTTP status codes:
Status CodeDescription
200The request was successful.
400Invalid input - the file is corrupt or the supported inputs are not provided.
401Required authentication information is either missing or not valid for the resource.
500If any unexpected error occurs while processing the request.

Supported Languages

Afrikaans, Amharic, Arabic, Azerbaijani, Bulgarian, Bangla, Bengali, Bosnian, Catalan, Czech, Welsh, Danish, German, Greek, English, Spanish, Estonian, Basque, Persian, Finnish, Filipino, French, Irish, Galician, Gujarati, Hebrew, Hindi, Croatian, Hungarian, Armenian, Indonesian, Icelandic, Italian, Japanese, Javanese, Georgian, Kazakh, Khmer, Kannada, Korean, Lao, Lithuanian, Latvian, Macedonian, Malayalam, Mongolian, Marathi, Malay, Maltese, Burmese, Norwegian, Nepali, Dutch, Polish, Pashto, Portuguese, Romanian, Russian, Sinhala, Slovak, Slovenian, Somali, Albanian, Serbian, Sundanese, Swedish, Swahili, Tamil, Telugu, Thai, Turkish, Ukrainian, Urdu, Uzbek, Vietnamese, Chinese, Zulu


All requests to ApyHub services need to be authenticated, currently we support tokens or basic authentication mechanisms. You can generate and view your existing credentials from workspace settings (on the left side of the navbar) and go to applications.
Points to note:
  • Credential secrets are generated on the fly and are not stored in plain text, so on generating a credential please save the secrets somewhere safe.
  • Use the apy-token as the header parameter to pass the token.
  • Use the Authorization header to send the basic authentication credentials.

Error codes

"error": {
"code": 105,
"message": "Invalid URL"
To search for a specific error code, enter the code in the search box below. Alternatively, you can click on the button to view a complete list of all error codes.