Text-to-Speech

Text To Speech

SDK

Use the SDK for safer, faster integration than manual HTTP calls.

SDK guide

Generate speech from text using the specified voice model. Supports emotion, volume, pitch, and tempo customization.

First, list all available voice models using the GET /v2/voices endpoint, then use the voice_id from the response to generate speech with this endpoint. Each voice model has its own unique characteristics. See Listing all voices for available voices.

POST/v1/text-to-speech

Authorizations

X-API-KEYstringheaderrequired

API key for authentication. You can obtain an API key from the Typecast API Console.

Body

application/json

Text-to-speech request parameters

seedinteger

Unsigned integer seed for reproducible speech generation. The same seed with the same input parameters will produce identical audio output.

  • Must be a non-negative integer (≥ 0). Negative values are not accepted.
  • If omitted, the server generates a random seed each time, producing slight variations.
textstringrequired

Text to convert to speech. Minimum 1 character, maximum 2000 characters. Credits consumed based on text length. Supports multiple languages including English, Korean, Japanese, and Chinese. Special characters and punctuation are handled automatically.

modelssfm-v30 | ssfm-v21required

Voice model to use for speech synthesis.

  • ssfm-v30: Latest model with improved prosody and additional emotion presets (recommended)
  • ssfm-v21: Stable production model with reliable quality
ssfm-v30ssfm-v21
outputobject

Audio output settings including volume (0-200), pitch (-12 to +12 semitones), tempo (0.5x to 2.0x), and format (wav/mp3) for controlling the final audio characteristics

Show nested model
volumeinteger

Adjusts the relative volume of the output audio: 0 (completely silent), 50 (half volume), 100 (standard volume, default), 150 (50% louder than standard), 200 (maximum volume, twice as loud as standard).

Since this only scales the existing volume, using volume can amplify the loudness differences between voices if they have different baseline levels. For consistent output across all clips, use target_lufs instead.

  • Note: This parameter cannot be used simultaneously with the target_lufs parameter.

Required range: 0 <= x <= 200

audio_pitchinteger

Adjusts the pitch in semitones to affect perceived gender and age: -12 (one octave lower, deeper voice), -6 (half octave lower), 0 (original pitch, default), +6 (half octave higher), +12 (one octave higher, higher voice)

audio_temponumber

Controls speech speed: 0.5 (half speed, very slow and clear), 0.75 (slightly slower than normal), 1.0 (normal speaking speed, default), 1.5 (50% faster than normal), 2.0 (double speed, very fast speech)

target_lufsnumber

Sets the target absolute loudness (LUFS) for the output audio. This normalizes all generated voices to a consistent volume level, regardless of the original source's loudness. Values closer to 0 are louder, while values closer to -70 are quieter.

  • Required range: -70 <= x <= 0
  • Recommended values: -14 (common streaming standard), -23 (broadcast standard)
  • Note: This parameter cannot be used simultaneously with the volume parameter. Use target_lufs for consistent absolute loudness across different clips, or use volume for traditional relative scaling.
audio_formatwav | mp3

Output audio format.

WAV format:

  • Uncompressed PCM audio
  • 16-bit depth, mono channel, 44100 Hz sample rate
  • Higher quality, larger file size
  • Recommended for professional audio production

MP3 format:

  • Compressed MPEG Layer III audio
  • 320 kbps bitrate, 44100 Hz sample rate
  • Smaller file size
  • Recommended for web streaming and distribution
wavmp3
promptPrompt

Emotion and style settings for the generated speech, including emotion type (happy/sad/angry/normal) and intensity (0.0 to 2.0) to control the emotional expression

SmartPrompt (ssfm-v30)
next_textstring

Text that comes AFTER the text field in TTSRequest. Provides forward context for emotion inference.

The model analyzes the flow: previous_texttext (synthesized) → next_text

  • Maximum 2000 characters
  • Helps the model anticipate emotional transitions
  • Leave empty if no following context is available
emotion_typestring

Discriminator field to identify the prompt type. Must be set to "smart" for context-aware emotion inference.

previous_textstring

Text that comes BEFORE the text field in TTSRequest. Provides backward context for emotion inference.

The model analyzes the flow: previous_texttext (synthesized) → next_text

  • Maximum 2000 characters
  • Helps the model understand emotional build-up and context
  • Leave empty if no preceding context is available
PresetPrompt (ssfm-v30)
emotion_typestring

Discriminator field to identify the prompt type. Must be set to "preset" for preset-based emotion control.

emotion_presetnormal | sad | happy | angry | whisper | toneup | tonedown

Emotion preset to apply to the generated speech.

Supported emotions: normal, happy, sad, angry, whisper, toneup, tonedown

Check available emotions for each voice through the /v2/voices API.

normalsadhappyangrywhispertoneuptonedown
emotion_intensitynumber

Controls the strength of emotional expression in the generated speech.

  • 0.0: Completely neutral, no emotional coloring
  • 0.5: Subtle emotional hints
  • 1.0: Standard emotional expression (default)
  • 1.5: Strong emotional emphasis
  • 2.0: Maximum intensity, highly expressive
Prompt (ssfm-v21)
emotion_presetobject

Emotion preset to apply.

Supported emotions for ssfm-v21: normal, happy, sad, angry

Check available emotions for each voice through the /v2/voices API.

emotion_intensityobject

Controls the strength of emotional expression (0.0 to 2.0).

  • 0.0: Completely neutral
  • 1.0: Standard expression (default)
  • 2.0: Maximum intensity
languagestring

Language code following ISO 639-3 standard. Case-insensitive (both "ENG" and "eng" are accepted). If not provided, will be auto-detected based on text content.

ssfm-v30 Supported Languages (37)
CodeLanguage
ARAArabic
INDIndonesian
PORPortuguese
BENBengali
ITAItalian
RONRomanian
BULBulgarian
JPNJapanese
RUSRussian
CESCzech
KORKorean
SLKSlovak
DANDanish
MSAMalay
SPASpanish
DEUGerman
NANMin Nan
SWESwedish
ELLGreek
NLDDutch
TAMTamil
ENGEnglish
NORNorwegian
TGLTagalog
FINFinnish
PANPunjabi
THAThai
FRAFrench
POLPolish
TURTurkish
HINHindi
UKRUkrainian
VIEVietnamese
HRVCroatian
YUECantonese
ZHOChinese
HUNHungarian
ssfm-v21 Supported Languages (27)
CodeLanguage
ARAArabic
INDIndonesian
RONRomanian
BULBulgarian
ITAItalian
RUSRussian
CESCzech
JPNJapanese
SLKSlovak
DANDanish
KORKorean
SPASpanish
DEUGerman
MSAMalay
SWESwedish
ELLGreek
NLDDutch
TAMTamil
ENGEnglish
POLPolish
TGLTagalog
FINFinnish
PORPortuguese
UKRUkrainian
FRAFrench
HRVCroatian
ZHOChinese
voice_idstringrequired

Voice identifier. Two prefixes are supported:

  • tc_ — Built-in Typecast voices (e.g., tc_60e5426de8b95f1d3000d7b5). See Listing all voices for available IDs.
  • uc_ — Custom voices created via Instant cloning (e.g., uc_64a1b2c3d4e5f6a7b8c9d0e1). Only the owner of a cloned voice can use it.

Case-sensitive: must use lowercase prefix.

Response

200Success - Returns audio fileaudio/wav · audio/mpeg
⌘I