Text to Speech
Convert text into lifelike speech with the Text to Speech API.
Overview
The Text to Speech API turns input text into natural, human-like audio in a voice of your choice. Pick any voice from the library or one of your cloned voices, select a model, and request an audio stream or file.
Quickstart
Install the official SDK, then convert text to speech with a voice ID and a model. The example below returns MP3 audio from the multilingual model.
import { IntuneLabsClient } from "@intunelabs/intunelabs-js";
const client = new IntuneLabsClient({ apiKey: process.env.INTUNELABS_API_KEY });
const audio = await client.textToSpeech.convert("JBFqnCBsd6RMkjVDRZzb", {
text: "The first move is what sets everything in motion.",
modelId: "intune_multilingual_v2",
outputFormat: "mp3_44100_128",
});Pass your API key through an environment variable. Never hardcode secrets in client-side code or commit them to source control.
Supported models
intune_v3— the most expressive output, ideal for performance and multi-speaker dialogue.intune_multilingual_v2— stable, consistent quality for long-form narration.intune_flash_v2_5— ultra-low latency for real-time use.
Best practices
- Add punctuation and natural phrasing to guide pacing and intonation.
- Stream audio for interactive experiences to minimize time-to-first-byte.
- Cache repeated generations to save credits and reduce latency.
- Test voices against your content before committing to a production voice.
Was this page helpful?
Built withfern