Voice Tracking
Paygent provides a robust Session-based flow for tracking complex Voice AI interactions, including STT, LLM, and TTS usage.
Prerequisite: Complete the Voice Agent Setup before implementing voice tracking.
Complete Voice Session Flow
This example shows how to manage a voice session from start to finish:
Python
Node.js
Go
How it Works
Step 1 — Customer Onboarding
The CreateOrGetCustomer call ensures the customer exists in Paygent. If they don’t, we’ll create them instantly using the provided externalId.
Step 2 — Session Context
Initializing a voice session sets up a billing context for the call. This ensures all subsequent STT, LLM, and TTS usage is grouped under this single call session.
Step 3 — Granular Tracking
Track every step of the voice pipeline independently. Paygent calculates precise costs for each model used during the conversation.
Step 4 — Final Outcome
Finalize the session with setVoiceIndicator. Use the duration or outcome-based indicators to accurately bill your customers based on per-minute connectivity or success outcomes.
