apyhub
AUDIO PROCESSING · FILE CONVERSION

Convert Text to Speech API

What it does

Text to Speech converts plain text or document content into MP3 audio. Send text, a document URL, or an uploaded file together with a gender value, and get back either a binary MP3 download or a signed MP3 link depending on the endpoint you use.

Use the text endpoints when you already have content in your application. The request body accepts text or url plus gender set to male or female. For longer documents, you can point the API at a document URL or upload the file directly, then retrieve audio from the generated response. The text input supports up to 75,000 characters.

Text to Speech is useful for turning articles, PDFs, reports, and user-generated content into listenable audio for accessibility features, internal review, or content repurposing. If you need a direct file response, use the /text/file, /file/file, or /url/file endpoints. If you need a shareable result for downstream processing, use the matching /text/link, /file/link, or /url/link endpoints.

▣ ENDPOINT 01 / 06
POST
Extract text from document URL and return signed MP3 link
https://api.eu.apyverse.com/apyhub/text-to-speech/url/link

QUICKSTART

GUIDE

Quickstart

Convert a file URL to speech by sending its URL and voice gender.

curl -X POST "https://api.eu.apyverse.com/apyhub/text-to-speech/url/link" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.pdf","gender":"female"}'

What you'll get back

Returns a JSON object with a data string field. The data value is the generated result as a string.

{
  "data": "https://..."
}
TRY ITLIVE · 750 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

This endpoint takes a document URL and a voice gender, then returns a JSON object containing a data string. The data value is the generated signed MP3 link.

Request Body

ParameterTypeMandatoryDescription
urlStringYesThe document URL to process. Must be a valid URI.
genderENUMYesThe voice gender to use. Allowed values: male, female.

Response

Returns a JSON object with a data string field containing the signed MP3 link.

ParameterTypeMandatoryDescription
dataStringNoThe signed MP3 link.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 02 / 06
POST
Convert JSON text to MP3 download
https://api.eu.apyverse.com/apyhub/text-to-speech/text/file

QUICKSTART

GUIDE

Quickstart

Send the text and voice gender to generate an audio file.

curl -X POST "https://api.eu.apyverse.com/apyhub/text-to-speech/text/file" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello world, this is a sample speech synthesis request.","gender":"female"}'

What you'll get back

Returns a binary file (string with format: "binary"), which is the generated audio output.

TRY ITLIVE · 750 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Converts the supplied JSON text into an MP3 file for download. You send the text to synthesize and the speaker gender, and the endpoint returns binary audio data.

Request Body

ParameterTypeMandatoryDescription
textStringYesText to convert to speech. Maximum length: 75000 characters.
genderENUMYesSpeaker gender. Allowed values: male, female.

Response

Returns a binary file response containing the generated MP3 audio. The output schema is a string with binary format, so the success response is the audio download itself rather than a JSON object.

Body

Name
Type
Description
bodyREQUIRED
object
▣ ENDPOINT 04 / 06
POST
Extract text from uploaded document and return MP3
https://api.eu.apyverse.com/apyhub/text-to-speech/file/file

QUICKSTART

GUIDE

Quickstart

Convert an audio file to speech by uploading the file and choosing a voice gender.

curl -X POST "https://api.eu.apyverse.com/apyhub/text-to-speech/file/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/audio.mp3" \
  -F "gender=male"

What you'll get back

Returns a binary file (string with format: "binary"), which is the generated audio output.

(binary file)
TRY ITLIVE · 750 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

This endpoint accepts an uploaded document file and a gender choice, then returns the generated MP3 as a binary response.

Request Body

ParameterTypeMandatoryDescription
fileStringYesUploaded document file sent as binary data.
genderENUMYesVoice gender to use for the generated audio. Allowed values: male, female.

Response

Returns a binary file response containing the generated MP3 audio.

ParameterTypeMandatoryDescription

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 05 / 06
POST
Extract text from uploaded document and return signed MP3 link
https://api.eu.apyverse.com/apyhub/text-to-speech/file/link

QUICKSTART

GUIDE

Quickstart

Upload an audio file and choose a voice gender to generate speech from a file link.

curl -X POST "https://api.eu.apyverse.com/apyhub/text-to-speech/file/link" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/audio.mp3" \
  -F "gender=male"

What you'll get back

Returns a JSON object with a data string field containing the generated result.

{
  "data": "..."
}
TRY ITLIVE · 750 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.
body*

About this endpoint

What it does

Uploads a document file and a selected voice gender, then returns a signed MP3 link as a string in the response.

Request Body

ParameterTypeMandatoryDescription
fileStringYesThe uploaded document file, provided as binary data.
genderENUMYesVoice gender to use for the generated audio. Allowed values: male, female.

Response

Returns a JSON object with a data string field containing the signed MP3 link.

ParameterTypeMandatoryDescription
dataStringYesThe signed MP3 link returned by the endpoint.

Body

Name
Type
Description
bodyREQUIRED
object

Max 100MB total per request (all files combined). Larger? Use this API's URL-based endpoint instead, if it has one.

▣ ENDPOINT 06 / 06
POST
Extract text from document URL and return MP3
https://api.eu.apyverse.com/apyhub/text-to-speech/url/file

QUICKSTART

GUIDE

Quickstart

Convert a file from a public URL to speech by sending the source URL and voice gender.

curl -X POST "https://api.eu.apyverse.com/apyhub/text-to-speech/url/file" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "https://assets.apyhub.com/samples/sample.pdf",
    "gender": "female"
  }'

What you'll get back

Returns a binary file response containing the generated audio.

TRY ITLIVE · 750 ATOMS
Loading your default key…
The full key is used to call the gateway and stays in this tab — never sent to orbit or saved.
body*

About this endpoint

What it does

Downloads a document from the provided URL, extracts its text, and returns the generated MP3 as a binary response.

Request Body

ParameterTypeMandatoryDescription
urlStringYesDocument URL. Must be a valid URI.
genderENUMYesVoice gender for the generated audio. Allowed values: male, female.

Response

Returns a binary file response containing the generated MP3 audio.

ParameterTypeMandatoryDescription
binaryStringYesBinary MP3 content returned by the endpoint.

Body

Name
Type
Description
bodyREQUIRED
object
▣ COMMON ERRORS

Errors any endpoint can return

400bad_request

Required parameter missing or malformed body.

401unauthorized

API key missing, revoked, or not authorized for this service.

429rate_limited

Your plan's per-second rate exceeded. Retry with exponential backoff.

503upstream_busy

Backend temporarily unavailable. Try again in a few seconds.