Skip to main content

Cost Tracking

Arkenos 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.
ServiceProviderUnitRateHourly Equivalent
STTDeepgramper minute$0.0077$0.46/hr
STTAssemblyAIper minute$0.0078$0.47/hr
STTElevenLabsper minute$0.0167$1.00/hr
LLMGoogle Gemini 2.5 Flashper 1K tokens (blended)$0.00086~$0.86/1M tokens
TTSResemble AIper character$0.00004$40/1M chars
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

{
  "session_id": "uuid",
  "user_id": "user-id",
  "agent_id": "agent-uuid",
  "provider": "assemblyai",
  "event_type": "stt_minutes",
  "quantity": 2.5,
  "unit_cost": 0.0078,
  "total_cost": 0.0195
}

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:
ProviderServiceUnitsCost
AssemblyAISTT2.5 minutes$0.0195
Google GeminiLLM1,250 tokens$0.0011
Resemble AITTS450 characters$0.0180
Total$0.0386

What’s Not Tracked

Arkenos 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

# Cost summary
curl -H "x-user-id: your-user-id" http://localhost:8000/api/costs/summary

# Cost timeline (daily/weekly/monthly)
curl -H "x-user-id: your-user-id" "http://localhost:8000/api/costs/timeline?period=daily"

# Cost by agent
curl -H "x-user-id: your-user-id" http://localhost:8000/api/costs/by-agent