Skip to main content
POST
cURL

Authorizations

X-API-KEY
string
header
required

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

Query Parameters

granularity
enum<string>

Filter for which timestamp arrays to return.

  • Omitted: returns both words and characters.
  • word: returns words only (characters is null).
  • char: returns characters only (words is null).

Languages without whitespace (e.g., jpn, zho): word alignment yields a single segment covering the whole sentence, so use char to obtain meaningful timestamps.

Available options:
word,
char

Body

application/json

Text-to-speech request parameters

voice_id
string
required

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.

Example:

"tc_60e5426de8b95f1d3000d7b5"

text
string
required

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.

Required string length: 1 - 2000
Example:

"Everything is so incredibly perfect that I feel like I'm dreaming."

model
enum<string>
required

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
Available options:
ssfm-v30,
ssfm-v21
Example:

"ssfm-v30"

language
string

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)
ssfm-v21 Supported Languages (27)

Timestamp endpoint note. For languages without inter-word whitespace — Japanese (jpn) and Chinese (zho) — word-level alignment collapses the whole sentence into a single segment. Always pair these languages with granularity=char to receive usable per-character timestamps.

Example:

"eng"

prompt
SmartPrompt (ssfm-v30) · object

Emotion and style settings for the generated speech.

Example:
output
Output · object

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

seed
integer<uint32>

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.
Required range: 0 <= x <= 4294967295
Example:

42

Response

Success - Returns base64 audio and timestamps

Response payload for POST /v1/text-to-speech/with-timestamps — base64-encoded audio plus per-word and per-character timestamps aligned with the generated speech.

audio
string
required

Base64-encoded audio bytes. Decode and write to a file using the audio_format extension.

audio_format
enum<string>
required

Audio encoding format of the bytes in audio — either wav or mp3, mirroring the request's output.audio_format.

Available options:
wav,
mp3
audio_duration
number
required

Length of the generated audio in seconds.

words
AlignmentSegmentWord · object[] | null
required

Word-level timestamps (with attached punctuation). null when the request uses granularity=char.

characters
AlignmentSegmentCharacter · object[] | null
required

Character-level timestamps (including punctuation and whitespace). null when the request uses granularity=word.