from elevenlabs import ElevenLabs
client = ElevenLabs(api_key="sk_...")
audio = client.text_to_speech.convert(
voice_id="U1me6X0sIhQz6nAjDuVU",
model_id="eleven_flash_v2_5",
text="Your platform just found its voice.",
) # streamed audio, ~75 ms to first byte$ curl -X POST https://api.elevenlabs.io/v1/text-to-speech/JBFqnCBsd6RMkjVDRZzb \
-H "xi-api-key: $ELEVENLABS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Your platform just found its voice.",
"model_id": "eleven_flash_v2_5"
}' --output speech.mp3$ elevenlabs text-to-speech convert \
--model-id eleven_flash_v2_5 \
--voice-id 3cjtcbSfNCiKYL34TDbF \
--text "Your platform just found its voice." \
--output speech.mp3
# npm i -g @elevenlabs/cli — one command from prompt to audio
import { ElevenLabsClient } from "elevenlabs";
const client = new ElevenLabsClient({ apiKey: process.env.ELEVENLABS_API_KEY! });
const audio = await client.textToSpeech.convert("6ce2j5ZU8hRGBD9VwEaX", {
text: "Your platform just found its voice.",
modelId: "eleven_flash_v2_5",
}); // fully typed, edge-ready