Voice Gateway Setup Guide
Deploy an AI Agent as a voice-enabled endpoint with WebRTC support. Users can talk to the agent directly in their browser.
Prerequisites
- A Project — use
list_resources { resourceType: "project" }to find one, or letcreate_ai_agentcreate one automatically. - A Flow — the conversation logic the voice endpoint connects to. Use
list_resources { resourceType: "flow", projectId }to find existing flows. - An LLM — the agent needs an LLM to generate responses. Use
setup_llmif not configured.
Quick Start
1. Create a Voice Gateway endpoint
{
"projectId": "<24-char hex>",
"flowId": "<flow referenceId>",
"name": "My Voice Agent"
}
This automatically:
- Creates a
voiceGateway2endpoint - Provisions a WebRTC client
- Returns a
webrtcDemoUrlthe user can open in a browser
2. Customize the WebRTC widget (optional)
{
"projectId": "<24-char hex>",
"flowId": "<flow referenceId>",
"name": "My Voice Agent",
"webrtcWidgetConfig": {
"label": "Support Agent",
"theme": "AI_PURPLE",
"transcription": { "enabled": true },
"tagline": "How can I help you today?",
"avatarLogoUrl": "https://example.com/avatar.png"
}
}
3. Update an existing endpoint
{
"endpointId": "<24-char hex>",
"webrtcWidgetConfig": {
"theme": "CLEAN_WHITE"
}
}
WebRTC Widget Themes
| Theme | Description |
|---|---|
DARK_MODE |
Dark background (default) |
CLEAN_WHITE |
Light/white background |
AI_PURPLE |
Purple accent theme |
URLs in the Response
| Field | Purpose |
|---|---|
webrtcDemoUrl |
Open in browser to talk to the agent — always show this to users |
_integration.wsEndpointUrl |
WebSocket URL for programmatic/embedded use |
_integration.embeddingSnippet |
HTML code to embed the voice widget on a website |
Embedding on a Website
Copy the embeddingSnippet from the response into your HTML page. It loads the Cognigy WebRTC widget and connects to the voice endpoint automatically.
Typical Full Workflow
create_ai_agent→ getflowIdandprojectIdsetup_llm→ configure LLM for the projectmanage_voice_gateway { projectId, flowId }→ getwebrtcDemoUrl- Share the URL with the user