Choose a setup method
Start with one method for a call path. Combining SDK tracking with framework
OpenTelemetry on the same call can create duplicate interactions.
Recommended: Agnost AI skill
Recommended. Choose this path when you want your coding agent to inspect the
project, select a supported transport, make the smallest instrumentation change,
send a test event, and verify that it reached Agnost AI.
call.ended webhook when a call finishes, but the payload holds only the call object. The transcript lives behind the List Call Messages API, which needs your Ultravox API key. To keep that key on your own server, Agnost AI does not receive Ultravox webhooks directly. Instead, your webhook handler fetches the messages and records each exchange with the Agnost AI SDK.
Hosted Ultravox calls do not export OpenTelemetry traces, so this guide has no OpenTelemetry section. If you run the Ultravox model inside Pipecat or LiveKit Agents, use the OpenTelemetry route for those frameworks instead. See Ultravox in Pipecat or LiveKit Agents.
Manual setup: Agnost AI SDK
Install
Add the webhook handler
Save this asultravox_webhook.py. It verifies the Ultravox signature, answers 204 right away, then fetches the call’s messages and sends one Agnost AI event per caller and agent exchange.
callId. The agent name comes from the Ultravox agent’s name. The user ID comes from a user_id key in the call’s metadata, so set it when you create the call. Without it, the call ID is used. Tool calls the agent made while answering are attached to that exchange as the tool_calls property.
The call is over when the webhook arrives, so the handler uses agnost.track() with the exchange’s input, output, and latency rather than begin() and end().
Subscribe to call.ended
Expose the handler at a public HTTPS URL, then create the webhook with the Ultravox API:agentId, the webhook covers every call in your account. Add "agentId": "<agent-id>" to cover one agent.
Verify
- Place a short call with the agent and say at least one sentence as the caller.
- Check your server log for a
204response toPOST /ultravox/webhook. - In app.agnost.ai, open Conversations and find the Ultravox call ID. Each exchange shows the caller’s words as input and the agent’s reply as output, with an
exchange_indexproperty that gives its order in the call.
Troubleshooting
- The handler returns
401: check thatULTRAVOX_WEBHOOK_SECRETmatches a secret on the Ultravox webhook, and that your server clock is correct. The handler rejects deliveries more than one minute old. - The handler returns
204but no conversation appears: the call was never joined, or the caller never spoke. Check the server log for an error from the messages request, such as a401from a wrongULTRAVOX_API_KEY. - Exchanges show the time they were sent instead of their time in the call:
agnost0.2.1 on PyPI does not forward thetimestampargument yet. Useexchange_indexto read the order. - A call appears twice: Ultravox can deliver the same webhook more than once and retries failed deliveries. Store the call IDs you have processed and skip repeats.
- Users show as call IDs: set a
user_idkey in the call’smetadatawhen you create the call.
Ultravox in Pipecat or LiveKit Agents
Pipecat and LiveKit Agents both ship an Ultravox integration. When Ultravox runs inside one of those frameworks, the framework’s own telemetry covers the call, so follow the Agnost AI Pipecat or LiveKit guide and skip the webhook handler above.References
- Ultravox webhooks overview
- Ultravox available webhooks
- Securing Ultravox webhooks
- Ultravox webhook retries
- List Call Messages API
- Ultravox with Pipecat and with LiveKit
- Agnost AI Python SDK
Next steps
- Conversations: review complete Ultravox calls.
- Events: inspect each caller and agent exchange.
- Patterns: understand why callers contacted the agent.