Skip to main content
POST
Generate Speech

Authorizations

x-api-key
string
header
required

HeyGen API key. Obtain from your HeyGen dashboard.

Body

application/json
voice_id
string
required

Identifier of the voice used for speech synthesis.

Minimum string length: 1
text
string
required

Plain text to synthesize. A professional voice clone takes pauses (seconds, up to 5 per pause, e.g. ); other SSML, and break tags for an instant voice clone, are not supported.

Required string length: 1 - 5000
model
enum<string>
default:heygen-voice-1

heygen-voice-1: instant and professional voices. heygen-voice-1-turbo: heygen-voice-1 instant voices only, at lower latency.

Available options:
heygen-voice-1,
heygen-voice-1-turbo
language
string | null

Language code of text. Regional tags normalize to their supported base language, such as en-US to en. Omit it to detect the language from text. A confident reading that matches the letters of text is used, and the request fails with invalid_parameter if HeyGen Voice does not speak that language. Otherwise the first of these that HeyGen Voice speaks is used: the language the voice was created in, if text is written in that language's script; a less certain reading that a second reading of text without its numbers and brand names agrees with; the usual language of the script text is mostly written in, such as English for Latin letters; and, only when that script has no usual language, the reading itself. If none of them applies, the request fails with invalid_parameter. The Content-Language response header names the language used.

Minimum string length: 1
expressiveness_boost
number
default:1

Expressiveness boost for instant voices on HeyGen Voice 1.0, from 0.0 to 1.0. Omit for professional voices.

Required range: 0 <= x <= 1
seed
integer | null

Optional best-effort deterministic generation seed for professional clones. Ignored for instant clones.

Required range: 0 <= x <= 4294967295
speed
number | null

Speech speed multiplier for professional clones. Ignored for instant clones, including Turbo.

Required range: 0.75 <= x <= 1.25
pitch_shift
number | null

Pitch shift in semitones for professional clones. Ignored for instant clones.

Required range: -4 <= x <= 4
pitch_variance
number | null

Pitch variation multiplier for professional clones; 1.0 preserves the voice default. Ignored for instant clones.

Required range: 0.5 <= x <= 2
with_timestamps
boolean
default:false

Whether to include original_characters in the response: the start and end time of each character of text.

Response

Successful response

data
CreateSpeechResponseData · object