Skip to main content
POST
Synthesize speech
Synthesizes text with the given voice and returns the raw audio bytes in the response body. The voice must be enrolled (status ready). You can use your workspace’s own voices and the public platform voices returned by List voices.
Unlike the JSON endpoints, a successful response is the audio file itself - not a JSON envelope. Errors still return the standard envelope.

Authorization

string
Your workspace API key (flv_…), from server-side code. Required scope: tts.
string
Alternative for browsers: Bearer fin_tok_…, a short-lived, single-use token your server minted with Create an access token. Send either this or X-API-Key.

Path parameters

string
required
The voice id.

Body

string
required
The text to synthesize. Maximum 10,000 characters. Billed per character against your plan’s monthly allowance; repeating an identical request (same voice, text, and parameters) is served from cache and not billed again.
string
BCP-47 language code (for example en, hi). Defaults to the voice’s primary language.
string
default:"wav"
Output encoding. One of wav, s16le, s24le, s32le, f32le, f64le, mulaw. wav is a self-contained file; the s*/f* formats are raw, headerless PCM; mulaw is raw G.711 µ-law for phone calls and requires sample_rate: 8000.
integer
default:24000
Output sample rate in Hz. Defaults to the provider’s native rate (24000); values above it are upsampled. 8000 (telephony) is produced as asked; other rates below 24000 return 24000.
integer
default:32
Number of inference steps, 1–32 (a quality/latency trade-off). Provider default (32) if omitted.
number
Accepted (0.0–1.0) but has no effect today: the engine ignores it, so the audio is the same with or without it.

Response headers

string
The audio MIME type, e.g. audio/wav for output_format: wav.
string
The sample rate of the returned audio, in Hz (when reported by the provider).
string
A public URL to the stored audio file, when object storage is enabled. Useful for download/share.
string
Your remaining character allowance for the month (present when billing is active). An exhausted allowance returns 402 when enforcement is on - either a flat billing body or the standard envelope with message: "insufficient_credits", see Errors.
See Synthesize parameters for the full field reference.

Prompt

Copy this into your coding agent (Claude Code, Cursor, Codex…) to implement this endpoint.