Back to blog

Text-to-Speech API Guide: Add Voiceover to Your Product

Integrate text to speech with a VoiceSmiths API key: create a key, call generation, get audio plus character timestamps, credit billing and error handling.

Aug 24, 2026VoiceSmiths TeamVoiceSmiths Team

Listen to this article

AI narration · about 2 min
0:00 / –:––
Text-to-Speech API Guide: Add Voiceover to Your Product

The studio is for humans; bulk generation inside a product goes through the API. This guide follows the integration order.

1. Create an API key

Sign in and open API keys. Create one — it's shown once, so store it safely; revoke and recreate from the same page if it leaks.

Text-to-Speech API Guide: Add Voiceover to Your Product

2. Generate speech

Submit text, a voice ID and a model; you get back an audio URL plus character-level timestamps (start/end seconds per character), so subtitles need no post-processing. The body mirrors the studio: text, voiceId, modelId, optionally stability, similarity, style, speed, seed.

For long text use the long-form endpoint: up to 50,000 characters, auto-chunked with context continuity, returning one file and a full timeline.

3. Pick voices and models

  • Voice IDs come from your library — community, cloned and designed voices all work
  • Models: flagship (expressive, emotion tags) / multilingual standard / flash (half price, low latency) — see choosing a model
  • Brand names and terms go in a pronunciation dictionary, defined once, applied everywhere

4. Billing and failures

Each call deducts credits per operation, matching the studio's button prices; upstream failures refund in full automatically — your code never handles refunds. Insufficient balance returns a clear error; buy a plan as needed.

5. Common errors

SymptomCauseFix
401Invalid or revoked keyCreate a new key
Insufficient creditsBalance is zeroTop up or use a cheaper model
Text too longOver the model's per-request capUse the long-form endpoint
Wrong accentVoice doesn't match the languageUse a native voice per language — see multilingual accents

Create my API key →