TL;DR โ Switch in Under 15 Minutes
- Drop the elevenlabs SDK โ use the OpenAI SDK's audio.speech API
- Plus access to OpenAI TTS, Bark, and 200+ other models on the same key
OpenAI's text-to-speech model. Six built-in voices with natural intonation.
Why Move Off ElevenLabs?
ElevenLabs is the gold standard for realistic TTS. The trade-offs for EU teams: a proprietary SDK that does not match the rest of your AI stack.
Step 1 โ Get a Railwail API Key
Sign up at railwail.com and generate a key.
Step 2 โ Replace the SDK Call
Before (ElevenLabs):
import { ElevenLabsClient } from "elevenlabs";
const el = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY });
const audio = await el.generate({
voice: "Rachel",
text: "Hello world",
model_id: "eleven_multilingual_v3",
});
// audio is a Readable streamAfter (Railwail):
import OpenAI from "openai";
const client = new OpenAI({
apiKey: process.env.RAILWAIL_API_KEY,
baseURL: "https://railwail.com/api/v1",
});
const res = await client.audio.speech.create({
model: "openai-tts-1",
voice: "alloy",
input: "Hello world",
response_format: "mp3",
});
const buffer = Buffer.from(await res.arrayBuffer());
require("fs").writeFileSync("out.mp3", buffer);from openai import OpenAI
client = OpenAI(
api_key=os.environ["RAILWAIL_API_KEY"],
base_url="https://railwail.com/api/v1",
)
with client.audio.speech.with_streaming_response.create(
model="openai-tts-1",
voice="alloy",
input="Hello world",
response_format="mp3",
) as resp:
resp.stream_to_file("out.mp3")curl https://railwail.com/api/v1/audio/speech \
-H "Authorization: Bearer $RAILWAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "openai-tts-1",
"voice": "alloy",
"input": "Hello world",
"response_format": "mp3"
}' \
-o out.mp3API Endpoint Mapping
Why Railwail Over ElevenLabs Direct
- OpenAI-compatible audio.speech API โ unify with your text/image/STT stack
- Plus alternative TTS providers (OpenAI TTS, Bark, Coqui XTTS) on the same key
- Built-in playground at railwail.com/models for voice preview
FAQ
What audio formats are returned?
response_format supports mp3 (default), opus, aac, flac, wav, pcm.
What about ElevenLabs Conversational AI / agents?
ElevenLabs' Conversational AI is a full agent product, not exposed via Railwail. For equivalent functionality, build a custom agent using Railwail's chat.completions + audio.speech + audio.transcriptions endpoints.
Is dubbing / audio-to-audio supported?
ElevenLabs Dubbing is a separate product. For dubbing workflows, transcribe with Railwail's audio.transcriptions, translate with chat.completions, then re-synthesise with audio.speech.
Next Steps
- Sign up at railwail.com
- Generate an API key
- Replace elevenlabs SDK with OpenAI SDK
- Read the reference at railwail.com/docs
- Browse voices at railwail.com/models?category=speech_tts
- Compare pricing at railwail.com/pricing
Models in this article
Live prices from Railwail's current rules, October 7, 2026.
- OpenAI TTS-1OpenAI$0.018 per 1,000 charactersTry
Next step
Try OpenAI TTS-1 on Railwail
Sign in with Google for 10 free credits (usable 24 hours after sign-up, runs up to 2 credits), or top up from $5.00. Unused balance does not expire.