apyhub
AUDIO PROCESSING · SMART GENERATION

Advanced Text to Speech API

What it does

Audio Generation lets you create speech from text and inspect the available audio models for text-to-speech and speech-to-text workflows. Send a text input in the speech endpoint, optionally set model, speed, voice, language, stability, instructions, response_format, and similarity_boost, and get back an audio file.

Use it when you need spoken output for product walkthroughs, accessibility features, voice notifications, or localized content. The model listing endpoint returns stt and tts arrays so you can compare providers and capabilities before you generate or process audio.

For STT models, the response includes fields such as id, name, provider, releasedAt, maxDurationS, maxFileSizeB, pricePer1Min, and supportedLanguages, plus streaming details when available. For TTS models, you get id, name, provider, speedMin, speedMax, latencyMs, releasedAt, maxCharacters, pricePer1KChar, and supportedFormats. That makes Audio Generation useful both for runtime speech creation and for selecting the right model for your application.

▣ ENDPOINT 01 / 02
GET
List audio models
https://api.eu.apyhub.com/llmapi-gateway/audio-text-speech/audio-models

QUICKSTART

GUIDE

Quickstart

List the available audio models with a simple authenticated GET request.

curl -X GET "https://api.eu.apyhub.com/llmapi-gateway/audio-text-speech/audio-models" \
  -H "apy-token: $APY_TOKEN"

What you'll get back

Returns a JSON object with two array fields: stt for speech-to-text models and tts for text-to-speech models. Each array item is an object with the model details declared in the schema.

{
  "stt": [],
  "tts": []
}
TRY ITLIVE · 10 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.

About this endpoint

What it does

Returns the available audio models grouped into speech-to-text (stt) and text-to-speech (tts) lists. Each list contains model objects with the fields defined in the response schema.

Response

Returns a JSON object with two array fields: stt for speech-to-text models and tts for text-to-speech models. Each array item is an object containing the model metadata shown below.

ParameterTypeMandatoryDescription
sttObject ArrayYesSpeech-to-text models. Each item includes id, name, provider, releasedAt, maxDurationS, maxFileSizeB, pricePer1Min, supportedLanguages, and may include a streaming object.
ttsObject ArrayYesText-to-speech models. Each item includes id, name, provider, speedMax, speedMin, latencyMs, releasedAt, maxCharacters, pricePer1KChar, and supportedFormats.

Parameters

No parameters.
▣ ENDPOINT 02 / 02
POST
Create speech
https://api.eu.apyhub.com/llmapi-gateway/audio-text-speech/v1/audio/speech

QUICKSTART

GUIDE

Quickstart

Generate speech audio from a text prompt and save the returned file.

curl -X POST "https://api.eu.apyhub.com/llmapi-gateway/audio-text-speech/v1/audio/speech" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Hello, this is a quick test of text to speech.",
    "model": "eleven_multilingual_v2",
    "voice": "Rachel"
  }'

What you'll get back

Returns a file response, not JSON. The response body is the generated audio stream for the requested speech output.

TRY ITLIVE · 10 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*
ElevenLabs: 0–1, default 0.5
OpenAI gpt-4o-mini-tts: accent/style steering
ElevenLabs: 0–1, default 0.75

About this endpoint

What it does

Creates synthesized speech from the provided text input and returns the generated audio as a file.

Request Body

ParameterTypeMandatoryDescription
inputStringNoText to convert into speech.
modelStringNoSpeech model to use.
speedNumberNoSpeech speed.
voiceStringNoVoice to use for synthesis.
languageStringNoLanguage for the generated speech.
stabilityNumberNoElevenLabs: 0–1, default 0.5.
instructionsStringNoOpenAI gpt-4o-mini-tts: accent/style steering.
response_formatStringNoAudio response format.
similarity_boostNumberNoElevenLabs: 0–1, default 0.75.

Response

Returns a file containing the generated speech audio.

ParameterTypeMandatoryDescription
fileFileYesThe generated audio file 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.