Skip to main content
Monitor agent performance, call history, and usage statistics.
Prerequisites: API key, deployed agents

Dashboard Statistics

Get comprehensive dashboard statistics for your agents from the last 90 days, including call durations and credit spend.
import requests

response = requests.get(
    'https://dev.voice.ai/api/v1/agent/dashboard',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

stats = response.json()
print(f"Total calls: {stats['total_calls']}")
print(f"Total duration: {stats['total_duration_minutes']} minutes")
print(f"Total credits: {stats['total_credits']}")
Response:
{
  "total_calls": 1250,
  "total_duration_minutes": 3420.5,
  "total_credits": 342.05,
  "average_call_duration_minutes": 2.74,
  "period_start": "2024-01-01T00:00:00Z",
  "period_end": "2024-03-31T23:59:59Z"
}

Stats Summary

Get a summary of statistics for all your agents, including call counts and durations.
import requests

response = requests.get(
    'https://dev.voice.ai/api/v1/agent/stats-summary',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

summary = response.json()
print(f"Total agents: {summary['total_agents']}")
print(f"Active agents: {summary['active_agents']}")
for agent in summary['agent_stats']:
    print(f"{agent['agent_name']}: {agent['call_count']} calls")

Call History

Retrieve paginated call history with optional filtering by agent ID and date range.
import requests

response = requests.get(
    'https://dev.voice.ai/api/v1/agent/call-history',
    headers={'Authorization': 'Bearer YOUR_API_KEY'},
    params={
        'page': 1,
        'page_size': 20,
        'agent_id': 'agent_123',  # Optional
        'start_date': '2024-01-01',  # Optional
        'end_date': '2024-01-31'  # Optional
    }
)

data = response.json()
for call in data['calls']:
    print(f"{call['call_id']}: {call['duration_seconds']}s - {call['status']}")
Response:
{
  "calls": [
    {
      "call_id": "call_abc123",
      "agent_id": "agent_123",
      "agent_name": "Support Agent",
      "duration_seconds": 180,
      "status": "completed",
      "started_at": "2024-01-15T10:30:00Z",
      "ended_at": "2024-01-15T10:33:00Z"
    }
  ],
  "total": 1250,
  "page": 1,
  "page_size": 20,
  "total_pages": 63
}

Call Transcript

Retrieve the full transcript for a specific call using the summary ID from call history.
import requests

response = requests.get(
    f'https://dev.voice.ai/api/v1/agent/call-history/{summary_id}/transcript',
    headers={'Authorization': 'Bearer YOUR_API_KEY'}
)

transcript = response.json()
print(f"Call ID: {transcript['call_id']}")
print(f"Duration: {transcript['duration_seconds']}s")
for message in transcript['messages']:
    print(f"{message['role']}: {message['content']}")
Response:
{
  "call_id": "call_abc123",
  "summary_id": "summary_xyz789",
  "agent_id": "agent_123",
  "duration_seconds": 180,
  "messages": [
    {
      "role": "agent",
      "content": "Thank you for calling. How can I help you?",
      "timestamp": "2024-01-15T10:30:00Z"
    },
    {
      "role": "user",
      "content": "I need help with my order",
      "timestamp": "2024-01-15T10:30:05Z"
    }
  ],
  "started_at": "2024-01-15T10:30:00Z",
  "ended_at": "2024-01-15T10:33:00Z"
}

Use Cases

  • Performance Monitoring: Track call volumes, durations, and success rates
  • Cost Analysis: Monitor credit usage and optimize agent configurations
  • Quality Assurance: Review transcripts to improve agent prompts and responses
  • Agent Comparison: Compare performance across different agents

Next Steps