Hume AI
Updated
Use Hume AI for text-to-speech (TTS) in a Conversational AI Platform agent.
Preview documentation
Hume AI provides emotion-aware text-to-speech technology that generates natural, expressive voices with emotional intelligence. The platform offers both curated voices from the Voice Library and support for custom voice creation, enabling personalized audio experiences.
Sample configuration
The following example shows how to configure Hume AI as the agent's TTS when you create or update an agent. For a complete example, see Create an agent and start a session.
Hume AI supports BYOK only. It isn't available in managed mode. Store your Hume AI API key in a secret set, and refer to it from the agent. For details, see Use your own provider keys.
from agora_agent import Agent, HumeAITTS, secret_ref
# client is your configured Agora client
agent = (
Agent(client=client)
.with_stt(...) # configure your ASR vendor
.with_llm(...) # configure your LLM vendor
.with_tts(
HumeAITTS(
key=secret_ref("support_prod", "humeai"),
base_url="https://api.hume.ai",
voice_id="<your_voice_id>",
provider="HUME_AI",
speed=1.0,
trailing_silence=0.35,
)
)
)import { Agent, HumeAITTS, secretRef } from 'agora-agents';
// client is your configured Agora client
const agent = new Agent({ client })
.withStt(/* configure your ASR vendor */)
.withLlm(/* configure your LLM vendor */)
.withTts(
new HumeAITTS({
key: secretRef('support_prod', 'humeai'),
baseUrl: 'https://api.hume.ai',
voiceId: '<your_voice_id>',
provider: 'HUME_AI',
speed: 1.0,
trailingSilence: 0.35,
}),
);// client is your configured Agora client
speed, trailingSilence := 1.0, 0.35
agent := agentkit.NewAgent(client).
WithStt( /* configure your ASR vendor */ ).
WithLlm( /* configure your LLM vendor */ ).
WithTts(vendors.NewHumeAITTS(vendors.HumeAITTSOptions{
Key: agentkit.SecretRef("support_prod", "humeai"),
BaseURL: "https://api.hume.ai",
VoiceID: "<your_voice_id>",
Provider: "HUME_AI",
Speed: &speed,
TrailingSilence: &trailingSilence,
}))Set credential.mode to byok and credential.fields.key to a reference to your Hume AI API key. In the following example, the key is stored as humeai in the support_prod set:
"tts": {
"credential": {
"mode": "byok",
"fields": {
"key": "$secrets.support_prod.humeai"
}
},
"vendor": "humeai",
"url": "https://api.hume.ai",
"params": {
"voice_id": "<your_voice_id>",
"provider": "HUME_AI",
"speed": 1,
"trailing_silence": 0.35
}
}Key parameters
The tts block takes the following fields. In the SDKs, HumeAITTS sets them from its options.
vendorstringSet to humeai.
credentialobjectSet mode to byok and fields.key to a $secrets.<set>.<key> reference to your Hume AI API key. Get your API key from the Hume AI console.
urlstringThe base URL for the Hume AI API. For example, https://api.hume.ai.
paramsobjectvoice_idstringThe identifier of the voice to use for speech synthesis. Choose from available voices in your Hume AI dashboard.
providerstring- Default value
- CUSTOM_VOICE
- Possible values
HUME_AICUSTOM_VOICE
The voice provider type.
"HUME_AI": Use a pre-built voice from Hume's curated Voice Library."CUSTOM_VOICE": Use your own custom-trained voice.
speednumber- Default value
- 1
- Possible values
0.25 to 3.0
Controls the playback speed of the generated speech. Higher values increase speech rate.
trailing_silencenumber- Default value
- 0.35
- Possible values
0 to 5
Duration of silence (in seconds) to add at the end of each utterance. Useful for natural conversation pacing.
Caution
The parameters listed on this page are validated for use with the Conversational AI Platform. Required parameters must be provided as documented. Any additional parameters in params are passed through directly to Hume AI without validation. For a full list of supported options, refer to the Hume AI TTS documentation.
This integration is fully supported for use with the Conversational AI Platform. While it has completed functional validation, it is newer to the platform, and additional provider-specific edge cases may be identified as usage scales across a broader range of applications and workloads.
