> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getbutter.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Agent Analytics

> View performance and cost metrics per agent.

Provides a breakdown of call volume, costs, and average duration for individual agents over a specified period. This helps identify which agents handle the most traffic or consume the most credits.

### Query Parameters

<ParamField query="start_date" type="string">
  Start date in `YYYY-MM-DD` format. Defaults to 30 days ago.
</ParamField>

<ParamField query="end_date" type="string">
  End date in `YYYY-MM-DD` format. Defaults to today.
</ParamField>

<ParamField query="start_datetime" type="string">
  Start exact time in ISO 8601 format (e.g. `2024-03-01T14:30:00Z`). Overrides `start_date`.
</ParamField>

<ParamField query="end_datetime" type="string">
  End exact time in ISO 8601 format. Overrides `end_date`.
</ParamField>

<ParamField query="limit" type="integer" default="10">
  Maximum number of agents to return. Values must be between `1` and `50`.
</ParamField>

### Response

<ResponseField name="success" type="boolean">
  Indicates whether the request was successful.
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="period" type="object">
      The start and end boundaries of the query.
    </ResponseField>

    <ResponseField name="agents" type="array">
      List of agents and their associated metrics.

      <Expandable title="items">
        <ResponseField name="agent_id" type="string">
          The unique identifier of the agent.
        </ResponseField>

        <ResponseField name="agent_name" type="string">
          The display name of the agent. Returns "Unknown" if the agent has been deleted.
        </ResponseField>

        <ResponseField name="total_calls" type="integer">
          Total number of calls processed by this agent during the period.
        </ResponseField>

        <ResponseField name="total_cost_credits" type="number">
          Platform credits consumed by this agent.
        </ResponseField>

        <ResponseField name="avg_duration_seconds" type="number">
          Average duration of calls in seconds for this agent.
        </ResponseField>
      </Expandable>
    </ResponseField>
  </Expandable>
</ResponseField>
