Deploy with Code (API & SDK)
Deploy with Code (API & SDK)
Integrate Voice Agents programmatically with APIs and SDKs. For platform speech APIs, see the API Reference.
What will be covered
Authenticate all requests with your API key.
Getting started (preview)
Use the dashboard API recipes as a starting point:
- Create or update an agent configuration: set up agents programmatically instead of through the UI
- Start a conversation session: initiate a voice or text session via API
- Trigger outbound calls: kick off calls to specific numbers with variable payloads
- Fetch transcripts and outcomes: pull conversation data into your systems for analysis or CRM updates
WebSocket integration
For real-time voice sessions, connect over the Conversations WebSocket interface. Handle audio frames, turn events, and tool-call signals according to the API contract.
Never expose production API keys in browser code. Keep secrets server-side and proxy WebSocket connections through your backend when building client-facing applications.
Embed the agent (widget)
To put a voice or chat agent on your website, embed the widget:
- Open your agent and go to the Embed option in Deploy with Code.
- Copy the embed snippet from the dashboard.
- Paste it into your site, typically before
</body>. - Load the page and confirm the widget initializes.
Customize the launcher position, theme, and which agent the widget uses from the dashboard, and re-test in test agent after changes.