Skip to main content

Cost Tracking

Nenyax tracks the cost of every API call made during voice sessions — STT minutes, LLM tokens, and TTS characters.

How Costs Are Tracked

  1. The agent worker logs usage events in real-time via POST /api/usage/events
  2. Each event records the provider, service type, units consumed, and calculated cost
  3. The backend aggregates costs for dashboards and reports

Provider Rates

Rates are defined in backend/app/cost_rates.py and can be updated in one place.
The Gemini rate is a blended estimate assuming a ~3:1 input-to-output token ratio. Actual rates: 0.30/1Minputtokens,0.30/1M input tokens, 2.50/1M output tokens.

Usage Event Structure

Dashboard Views

Cost Summary

Dashboard → Costs shows:
  • Total cost across all sessions
  • This month’s cost
  • Breakdown by provider (pie chart)

Cost Timeline

View costs over time with daily, weekly, or monthly granularity.

Cost by Agent

See which agents cost the most, helping you optimize prompts and configurations.

Per-Session Breakdown

Dashboard → Call Logs → [Session] shows the cost breakdown for a single call:

What’s Not Tracked

Nenyax currently does not track costs for:
  • LiveKit — connection minutes (~$0.0005/min per participant). These are billed by LiveKit directly.
  • Twilio — per-minute telephony charges for inbound/outbound calls. These are billed by Twilio directly.
These costs are external to the voice pipeline and must be monitored in each provider’s billing dashboard.

API Endpoints