ElevenLabs SDK-compatible TTS (HTTP streaming)
Generates speech with `client.textToSpeech.stream(...)` and returns audio as it is produced. The response `Content-Type` follows `output_format`: `mp3_*` → `audio/mpeg`, `pcm_*` → `audio/L16; rate=N`, otherwise `application/octet-stream`. Use `provider_options` for provider-specific settings. You can also pass supported options directly as query parameters. If both forms set the same option, `provider_options[<name>]=<value>` takes precedence. Recognized enum and boolean option values are case-insensitive and are normalized to each provider's wire spelling; free-form values such as prompts, keyterms, and voice IDs retain their original case.
/el/v1/text-to-speech/{voice_id}/streamGenerates speech with client.textToSpeech.stream(...) and returns audio as
it is produced. The response Content-Type follows output_format: mp3_* →
audio/mpeg, pcm_* → audio/L16; rate=N, otherwise
application/octet-stream.
Use provider_options for provider-specific settings. You can also pass
supported options directly as query parameters. If both forms set the same
option, provider_options[<name>]=<value> takes precedence. Recognized enum
and boolean option values are case-insensitive and are normalized to each
provider's wire spelling; free-form values such as prompts, keyterms, and voice
IDs retain their original case.
Tenant key (ElevenLabs SDK convention).
In: header
Path Parameters
Provider voice id (path segment). For Grok TTS, eve is the default voice.
Query Parameters
Comma-separated or repeated provider IDs in preferred order. Providers not listed remain eligible.
Comma-separated or repeated provider IDs. Only these providers may serve the request.
Comma-separated or repeated provider IDs that must not serve the request.
Set to false to prevent fallback to another provider. Automatic provider retries are not currently supported.
Output format (case-insensitive), such as mp3_44100_128 or pcm_16000. Formats the selected provider cannot emit natively are served by transcoding its best native stream.
Provider-specific options in bracket notation, such as provider_options[encoding]=linear16. You can also pass supported options directly as query parameters. If both forms set the same option, the bracketed value takes precedence.
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Text-to-speech request body.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
import { writeFile } from "node:fs/promises";const response = await fetch("https://api.allmodels.io/el/v1/text-to-speech/pNInz6obpgDQGcFmaJgB/stream", { method: "POST", headers: { ...{ Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` }, "Content-Type": "application/json" }, body: JSON.stringify({ "text": "Hello from AllModels", "model_id": "elevenlabs/eleven-turbo-v2-5", "output_format": "mp3_44100_128"})});if (!response.ok) throw new Error(`AllModels request failed: ${response.status}`);await writeFile("speech.mp3", Buffer.from(await response.arrayBuffer()));import osimport requestspayload = { "text": "Hello from AllModels", "model_id": "elevenlabs/eleven-turbo-v2-5", "output_format": "mp3_44100_128"}response = requests.post( "https://api.allmodels.io/el/v1/text-to-speech/pNInz6obpgDQGcFmaJgB/stream", headers={"Authorization": f"Bearer {os.environ['ALLMODELS_API_KEY']}"}, json=payload, timeout=60,)response.raise_for_status()with open("speech.mp3", "wb") as output: output.write(response.content)curl -X POST https://api.allmodels.io/el/v1/text-to-speech/pNInz6obpgDQGcFmaJgB/stream \ -H "Authorization: Bearer $ALLMODELS_API_KEY" \ -H "Content-Type: application/json" \ --output speech.mp3 \ --data '{ "text": "Hello from AllModels", "model_id": "elevenlabs/eleven-turbo-v2-5", "output_format": "mp3_44100_128"}'import { Buffer } from "node:buffer";import { writeFile } from "node:fs/promises";import { ElevenLabsClient } from "@elevenlabs/elevenlabs-js";const client = new ElevenLabsClient({ apiKey: process.env.ALLMODELS_API_KEY, baseUrl: "https://api.allmodels.io/el"});const audio = await client.textToSpeech.stream("pNInz6obpgDQGcFmaJgB", { text: "Hello from AllModels", modelId: "elevenlabs/eleven-turbo-v2-5", outputFormat: "mp3_44100_128"});const chunks = await Array.fromAsync(audio, (chunk) => Buffer.from(chunk));await writeFile("speech.mp3", Buffer.concat(chunks));import osfrom elevenlabs.client import ElevenLabsclient = ElevenLabs( api_key=os.environ["ALLMODELS_API_KEY"], base_url="https://api.allmodels.io/el",)audio = client.text_to_speech.stream( "pNInz6obpgDQGcFmaJgB", text="Hello from AllModels", model_id="elevenlabs/eleven-turbo-v2-5", output_format="mp3_44100_128",)with open("speech.mp3", "wb") as output: for chunk in audio: output.write(chunk)"string"{ "detail": { "message": "invalid json body", "status": "invalid_json" }}{ "error": "missing_api_key"}{ "detail": { "message": "this organization has insufficient prepaid balance", "status": "insufficient_balance" }}{ "error": "tenant_disabled"}{ "detail": { "message": "text exceeds 2000 characters", "status": "tts_text_too_large" }}{ "detail": { "loc": [ "body", "text" ], "msg": "field required", "type": "value_error.missing" }}{ "detail": { "message": "upstream text-to-speech request failed", "status": "upstream_error" }}Speech Engine conversation WebSocket GET
Connect using the signed_url returned by the signed URL endpoint. The client sends microphone audio directly to AllModels and receives transcripts, response text, and synthesized audio.
ElevenLabs SDK-compatible TTS (convert) POST
Generates speech with `client.textToSpeech.convert(...)`. It accepts the same request and returns the same streaming audio response as the `/stream` endpoint. Use `provider_options` for provider-specific settings. You can also pass supported options directly as query parameters. If both forms set the same option, `provider_options[<name>]=<value>` takes precedence. Recognized enum and boolean option values are case-insensitive and are normalized to each provider's wire spelling; free-form values such as prompts, keyterms, and voice IDs retain their original case.
