Skip to content

Analytics

Track call volume, platform-minute usage, carrier spend, sentiment distribution, and agent performance metrics.

Spend Overview

http
GET /v1/analytics/spend

Returns aggregated analytics across calls for the authenticated tenant. Filter by date range, agent, or call status.

Query Parameters

ParameterTypeRequiredDefaultDescription
fromstringNo30 days agoInclusive start date in YYYY-MM-DD format
tostringNoTodayInclusive end date in YYYY-MM-DD format
agent_iduuidNoAll agentsRestrict metrics to a specific agent
statusstringNoAll statusesFilter by call status: completed, failed, in_progress

Example Request

bash
curl "https://api.rymi.live/v1/analytics/spend?from=2026-03-01&to=2026-03-31&agent_id=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

json
{
  "total_calls": 140,
  "completed_calls": 120,
  "in_progress_calls": 2,
  "average_duration_seconds": 187,
  "success_rate": 0.72,
  "telecom_costs": {
    "total_minutes": 1450,
    "cost_usd": 46.50
  },
  "total_spent": 46.50,
  "time_series": [
    {
      "date": "2026-03-01",
      "calls": 8,
      "minutes": 34,
      "cost": 1.90
    }
  ],
  "status_distribution": {
    "completed": 120,
    "failed": 18,
    "in_progress": 2
  },
  "sentiment_distribution": {
    "positive": 40,
    "neutral": 61,
    "negative": 8,
    "unknown": 31
  },
  "agent_performance": [
    {
      "agent_id": "550e8400-e29b-41d4-a716-446655440000",
      "calls": 90,
      "minutes": 740.5,
      "cost": 25.10
    }
  ],
  "drop_off_points": [
    { "bucket": "<30s", "count": 3 },
    { "bucket": "30-60s", "count": 7 },
    { "bucket": "1-3m", "count": 25 },
    { "bucket": "3-5m", "count": 45 },
    { "bucket": ">5m", "count": 60 }
  ],
  "filters": {
    "from": "2026-03-01",
    "to": "2026-03-31",
    "agent_id": "550e8400-e29b-41d4-a716-446655440000",
    "status": null
  }
}

Response Fields

FieldTypeDescription
total_callsintegerTotal call count matching the filters
completed_callsintegerCalls that completed successfully
in_progress_callsintegerCalls currently active
average_duration_secondsintegerAverage call duration in seconds
success_ratenumberRatio of completed calls to total calls (0.0–1.0)
telecom_costs.total_minutesnumberTotal billed minutes
telecom_costs.cost_usdnumberTotal carrier cost in USD
total_spentnumberTotal spend in USD
time_seriesarrayDaily breakdown of calls, minutes, and cost
status_distributionobjectCall count grouped by final status
sentiment_distributionobjectCall count grouped by post-call sentiment
agent_performancearrayPer-agent breakdown of calls, minutes, and cost
drop_off_pointsarrayCall duration histogram showing where calls ended
filtersobjectEcho of applied filters

Errors

StatusMeaning
400Invalid date format or filter values
401Missing or invalid API key

INFO

Analytics data is aggregated from call records plus post-call intelligence. Real-time minute counts may be supplemented from Redis-backed live usage tracking when available.

Cost Scope

telecom_costs.cost_usd and total_spent are derived from each call's recorded total_cost. For self-serve BYOC, this reflects carrier spend only when the connected provider reports costs and the gateway persists them. LLM/STT/TTS provider token-level cost metering is on the roadmap.