GET
/
agent
/
{agent_id}
/
stats
Get agent statistics
curl --request GET \
  --url https://api.headlessagents.ai/agent/{agent_id}/stats \
  --header 'X-API-Key: <api-key>'
{
  "message_distribution": {
    "sample_size": 5,
    "assistant_messages": 5,
    "user_messages": 5
  },
  "response_time": {
    "sample_size": 5,
    "min_seconds": 3.77,
    "average_seconds": 17.41,
    "max_seconds": 24.99
  },
  "agent_id": "2ec10f28abac4e01",
  "turns_per_conversation": {
    "sample_size": 5,
    "average": 1
  },
  "message_length": {
    "user": {
      "sample_size": 5,
      "average": 11,
      "min": 11,
      "max": 11
    },
    "assistant": {
      "sample_size": 5,
      "average": 94.4,
      "min": 92,
      "max": 101
    }
  },
  "total_conversations": 610,
  "messages_per_conversation": {
    "average": 2,
    "max": 2,
    "min": 2
  },
  "total_messages": 100,
  "stats_generated_at": "2025-02-23T21:01:00.750638+00:00",
  "usage_timeline": {
    "last_7d": 50,
    "first_conversation": "2025-02-23T19:48:13.405391+00:00",
    "last_24h": 50,
    "last_conversation": "2025-02-23T19:55:13.683286+00:00",
    "last_30d": 50
  }
}
Retrieve usage statistics for a specific agent.

Endpoint

GET /agent/{agent_id}/stats

Parameters

agent_id
string
required
ID of the agent to get statistics for

Response

message_distribution
object
required
response_time
object
required
agent_id
string
required
ID of the agent
total_conversations
integer
Total number of conversations
total_messages
integer
Total number of messages
stats_generated_at
string
Timestamp when these statistics were generated
{
  "message_distribution": {
    "sample_size": 5,
    "assistant_messages": 5,
    "user_messages": 5
  },
  "response_time": {
    "sample_size": 5,
    "min_seconds": 3.77,
    "average_seconds": 17.41,
    "max_seconds": 24.99
  },
  "agent_id": "2ec10f28abac4e01",
  "total_conversations": 610,
  "total_messages": 100,
  "stats_generated_at": "2025-02-23T21:01:00.750638+00:00"
}

Authorizations

X-API-Key
string
header
required

API key provided by Headless Agents

Path Parameters

agent_id
string
required

ID of the agent to get statistics for

Response

200
application/json

Agent statistics retrieved successfully

The response is of type object.