Vapi Integration
Automatically track usage for Vapi Voice Agents using the VapiPaygentHook. This hook enriches your outbound calls with Paygent identity metadata, allowing the backend to attribute costs correctly.
Prerequisite: Complete the Voice Agent Setup before implementing voice tracking.
Required Vapi Configuration. To enable automatic usage reporting, you must configure the Server URL in your Vapi dashboard:
- Navigate to Settings > Org Settings > Server URL.
- Set the Server URL to:
https://cp-api.withpaygent.com/api/v1/webhooks/vapi - Add the following Custom Header:
- Header Key:
paygent-api-key - Header Value:
"your-paygent-api-key"
- Header Key:
Use attach() to automatically enrich all calls made by a Vapi client instance.
vapi_automatic.py
