Built for voice agents that can't wait 600ms

Published by AllModels

One API for real-time text-to-speech providers

Connect to multiple TTS models through AllModels. Stream audio over WebSocket, use an OpenAI- or ElevenLabs-compatible SDK, and switch models without rebuilding your voice stack.

AllModels is an independent service and is not affiliated with, endorsed by, or sponsored by the providers whose models it routes to.

What a unified TTS API is

A unified text-to-speech (TTS) API is a single integration that can generate speech with models from many different providers. Instead of writing one client for Cartesia, another for ElevenLabs, another for MiniMax and another for OpenAI, your application talks to one endpoint with one API key. The model you choose decides which provider does the work. AllModels is a unified TTS API of this kind: you send a model ID such as cartesia/sonic-3-6 or minimax/speech-2-8-hd, and AllModels routes the request to that provider and streams the audio back. The same idea goes by other names: a TTS aggregator API, a text-to-speech abstraction layer, or an "OpenRouter for text-to-speech".

How AllModels works

Every model in the AllModels TTS catalogue has a provider/model ID. You authenticate once with an AllModels API key, which replaces the separate keys and billing accounts you would otherwise keep with each provider. AllModels then offers three ways to call the same models:

  • Native WebSocket at wss://api.allmodels.io/v1/tts. You send text as it is produced and receive audio as binary messages. This is the AllModels-native real-time interface.
  • OpenAI-compatible at https://api.allmodels.io/oai. Point the official OpenAI SDK at this base URL and keep calling audio.speech.create.
  • ElevenLabs-compatible at https://api.allmodels.io/el. Point the official ElevenLabs SDK at this base URL and keep calling its text-to-speech methods, including streaming.

All three reach the same catalogue. If your codebase already uses the OpenAI or ElevenLabs SDK, you can move to AllModels by changing the base URL and API key.

One catalogue, one key, one balance

As an aggregator, AllModels also gives you one place to compare and control providers. GET /v1/models lists every TTS model, the providers that serve it and its price per 1,000 characters. When a model is available from more than one provider, a provider preference chooses between them: only pins the request to the providers you list, order puts them first and ignore leaves them out. Usage from every provider is charged to one prepaid AllModels balance instead of a separate bill per provider.

Change the model, keep everything else

Your API key, endpoint, client and request code stay exactly the same from one provider to the next. To use a different TTS model, change the model ID. AllModels takes care of the rest: it connects to the provider, handles its API and returns the audio to your application.

Stream real-time audio from any client

Choose a client, a mode and a language. Highlighted lines are the AllModels base URL and the model and voice values you change to try another model.

Client
Mode
Language

Native WebSocket, streaming JavaScript · Node.js · ws

Connect to wss://api.allmodels.io/v1/tts, send text as it is produced and receive audio as binary messages. Streaming guide.

import { once } from "node:events";
import { createWriteStream } from "node:fs";
import WebSocket from "ws";

const url = new URL("wss://api.allmodels.io/v1/tts");
url.searchParams.set("model", "grok/grok-tts");
url.searchParams.set("voice", "eve");
url.searchParams.set("format", "pcm");

const output = createWriteStream("reply.pcm");
const ws = new WebSocket(url, {
  headers: { Authorization: `Bearer ${process.env.ALLMODELS_API_KEY}` }
});

// Audio arrives as binary WebSocket messages.
ws.on("message", (data, isBinary) => {
  if (isBinary) output.write(data);
});

await once(ws, "open");
// Send text as your LLM or application produces it.
ws.send(JSON.stringify({ type: "text", text: "Your order has shipped. " }));
ws.send(JSON.stringify({ type: "text", text: "It arrives tomorrow." }));
ws.send(JSON.stringify({ type: "flush" }));
ws.send(JSON.stringify({ type: "close" }));

await once(ws, "close");
output.end();

Compatible interfaces

Use the client your team already knows

https://api.allmodels.io/oai

OpenAI-compatible

Already using the OpenAI SDK? Set its base URL to AllModels and keep calling audio.speech.create, now with an AllModels model ID. Streaming and single requests both work.

Read the OpenAI TTS docs

https://api.allmodels.io/el

ElevenLabs-compatible

Already using the ElevenLabs SDK? Set its base URL to AllModels and keep using its convert, stream and realtime methods, now with an AllModels model ID.

Read the ElevenLabs TTS docs

Quick answers

Real-time TTS API basics

What is a unified TTS API?

A unified TTS API gives applications one integration surface for multiple text-to-speech models. With AllModels, the chosen model ID determines the route while authentication and the core request flow remain consistent.

Does AllModels support real-time audio?

Yes. The native interface streams over WebSocket at /v1/tts, the ElevenLabs Python SDK streams text in over a compatible WebSocket, and both SDKs can stream audio back over HTTP. Streaming support varies by model.

Can I use every provider feature?

Yes. Common settings use the standard fields, and any provider-specific setting, such as voice settings, goes in provider_options and is passed directly to the provider.

Is there an OpenRouter for text-to-speech?

Yes. AllModels works like OpenRouter for voice: one API key and one endpoint give you text-to-speech models from multiple providers, selected by provider/model ID. It also accepts the official OpenAI and ElevenLabs SDKs, so existing code only needs a new base URL and key.

How is a TTS aggregator API different from an open-source abstraction library?

An open-source abstraction library runs inside your application and still needs your own account, API key and billing with every provider it wraps. An aggregator API such as AllModels is a hosted service: one key and one prepaid balance cover the whole TTS catalogue, and you call it with the OpenAI or ElevenLabs SDK you already use, or over a WebSocket.

How do I compare providers?

Browse the TTS catalogue to compare available models, routes, pricing, languages, voices, and API examples before changing the model ID in your application.

One integration in three steps
  1. 1
    Choose a model. Pick a TTS model from the live catalogue by its provider/model ID.
  2. 2
    Use one API key. Authenticate with AllModels instead of a separate key for every provider.
  3. 3
    Stream or generate. Stream over WebSocket for live audio, or request a complete file over HTTP.

Build with AllModels

Start with one TTS integration.

Choose a model now and keep the freedom to change it later.