HeyGen
Text-to-speech
HeyGen Voice is HeyGen’s text-to-speech engine, with two voice models and 66 public English voices.
Give an AI agent built with the SWML ai method a HeyGen voice
by naming the heygen engine in its voice string.
Models
The model comes from the voice string’s :<model> suffix, otherwise from the
heygen_model parameter, otherwise the default. Model IDs match exactly. Any other
ID, including HeyGen’s free-tier heygen-voice-1-turbo-free, uses the default.
Voices
The voice is either a HeyGen voice ID, 32 lowercase hexadecimal characters, or one of HeyGen’s public voices named by the first word of its name, in any case. The public voices are all English:
adam, bram, brian, cecily, chloe, christopher, claire, connor, conor, corinne,
craig, daniel, darren, elowen, emily, emma, eric, ethan, ewan, felicity,
gareth, harrison, hugh, huw, iona, jack, jackson, jake, james, jason,
jennifer, jessica, jocelyn, jonah, joshua, justin, kieran, liam, lucian,
marielle, matthew, meredith, michael, michelle, nadine, neha, nicola, noelle,
oliver, paul, rahul, richard, robert, rory, ryan, sabrina, sarah, sharon,
simon, sophie, soren, tabitha, thomas, victoria, vincent, and weston.
Any other voice, or no voice, speaks as nadine.
Languages
A HeyGen voice speaks in the language of the agent’s languages entry, sent as its
base language: en-US is sent as en. With no usable language code, HeyGen detects the language
from the text, which can fail on text such as a number on its own.
Usage
A voice identifier string has three parts: the heygen engine code, a voice, and an optional model.
The engine code must be exactly heygen.
Format: heygen.<voice>:<model>
voice(required): a public voice name or a HeyGen voice ID from Voices.model(optional): one of the models above.
Examples:
Parameters
These settings tune HeyGen voices. The first three go in the agent’s params; the last
goes in the voice’s own params, on a languages or multilingual.languages entry.
How HeyGen voices play
- Each reply’s first sentence streams, so playback starts at its first audio while the rest is generated in the background.
- HeyGen’s public voices take no speed control, so
auto_speedhas no effect. - A caller who interrupts stops the audio cleanly.
- A HeyGen voice that fails gives way to the next voice the agent has. See Voice fallback.
Rate limits
HeyGen sets its own limits: 5,000 characters per request and, by default, 30 requests per minute per HeyGen workspace member. HeyGen raises the request limit for enterprise accounts. Each spoken sentence is one request, so a busy call, or several calls on one key, can reach the limit. A request over the limit is retried.
Give an AI agent a HeyGen voice via SWML
The languages list of the SWML ai method sets
the voice an AI agent speaks in. This agent speaks with HeyGen’s Claire, with Cartesia’s Kurt as a
backup voice, and uses your own HeyGen key. The Server SDKs build the document
and serve it at /swml on port 3000, only to requests that carry the username signalwire and your
password.
Replace these values in the samples:
To send calls from your phone number to the server, follow
Answer a call via SWML.
Call the number, and the agent greets you in Claire’s voice. If you hear Nadine instead, the voice
name isn’t one of HeyGen’s public voices. If you hear Kurt, the HeyGen voice failed to open: check
that the key has the voices:write scope and contains only letters, digits, -, _, and ..