Skip to main content

Audio (Text to Speech) API

Convert text to natural-sounding audio using models from Qwen3, ElevenLabs, and OpenAI — all through a single endpoint with a credit-based pricing system.

Endpoints​

MethodPathDescription
POST/generate/text-speechConvert text to speech audio.

Parameters​

Request body fields for /generate/text-speech:

ParameterTypeRequiredDefaultDescription
promptstringYes—The text you want to convert to speech.
modelstringYes—Model ID to use. E.g. QWEN3/TTS-FLASH, ELEVENLABS/TTS, OPENAI/GPT-AUDIO-MINI.
outputTypestringNo"binary"Use "binary" to receive raw audio bytes, or "url" to get a hosted audio URL in JSON.
voicestringNo"alloy"Voice name (applies to OpenAI and ElevenLabs models only). E.g. alloy, nova, rachel, josh.
outputFormatstringNo"mp3"Audio format for the output (applies to OpenAI and ElevenLabs models only). Currently mp3.

Response example​

binary

Raw audio bytes (mp3 stream). Save directly to a file or create a Blob URL.

url

{
"success": true,
"url": "https://ai.imagegpt.online/imagegpt-pro-audio/1780682139387-amsq4xznzvi.wav",
"taskId": "imagegpt_qwen3/tts-flash-cu0zjaz1xlc1780682133698",
"duration": 1,
"creditsDeducted": 10
}

Examples​

Text-to-speech (fetch)
fetch('https://api.imagegpt.online/generate/text-speech', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': 'YOUR_API_KEY'
},
body: JSON.stringify({
prompt: 'Hello, welcome to ImageGPT!',
model: 'QWEN3/TTS-FLASH',
outputType: 'binary'
})
})
.then(res => res.blob())
.then(blob => {
const audio = new Audio(URL.createObjectURL(blob));
audio.play();
});

Pricing​

Charged in credits per request.

TierRangeDescriptionExamples
Economy3–10 creditsFast, lightweight TTS models.Qwen3 TTS Flash
Standard25–50 creditsHigh-quality voices for production.ElevenLabs TTS, GPT Audio Mini
Premium50–150 creditsUltra-realistic studio-quality audio.ElevenLabs V3, GPT Audio 1.5

Models​

Each model has its own page with parameters, examples, and a live playground.

ModelModel IDCredits / request
Qwen3 TTS FlashQWEN3/TTS-FLASH10
ElevenLabs TTSELEVENLABS/TTS50
GPT Audio MiniOPENAI/GPT-AUDIO-MINI25
GPT Audio 1.5OPENAI/GPT-AUDIO-1.550