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

# Metrics

> Spot anomalies in request volume, API calls, and token usage, then trace back to the cause.

The Metrics tab surfaces patterns you'd miss looking at individual threads: request spikes, token cost trends, and unexpected API call volume. Start here to spot anomalies, then switch to [Threads](/guides/observability/threads) to investigate the cause.

## Available charts

<Frame caption="Requests per day (11 total) and Outbound API calls by AI (5 total) as purple bar charts with date filtering.">
  <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/observability/metrics-requests.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=1f02af3ef2de50427dd5caf66bb45053" alt="Requests and API calls metrics" width="1225" height="577" data-path="images/observability/metrics-requests.png" />
</Frame>

| Chart                        | What it tracks                              | What to look for                                                                                                      |
| ---------------------------- | ------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| **Requests**                 | Agent/workflow runs per day                 | Sudden spikes (possible loop or misconfigured trigger), unexpected drops (broken webhook or expired schedule)         |
| **Outbound API calls by AI** | External API calls made by AI nodes per day | Ratio to requests. If API calls per request spike, an agent node may be looping or retrying excessively.              |
| **Input tokens by day**      | Tokens sent to LLMs                         | Steady growth means context is accumulating. Check if memory or conversation history is bloating prompts.             |
| **Output tokens by day**     | Tokens generated by LLMs                    | Spikes may indicate the model is generating verbose responses. Tighten instructions or add output format constraints. |
| **Total tokens by day**      | Combined input + output                     | Overall LLM spend trend. Compare before and after model tier changes to confirm savings.                              |

<Frame caption="Token usage charts: Input tokens (49 total) and Output tokens (2K total) with the same date-filtered format.">
  <img src="https://mintcdn.com/xpanderai-099931d1/OGlJJ1lp1VY3af7I/images/observability/metrics-tokens.png?fit=max&auto=format&n=OGlJJ1lp1VY3af7I&q=85&s=fe47c0c54b5863ee50b79ada6b7622a9" alt="Token usage metrics" width="1225" height="577" data-path="images/observability/metrics-tokens.png" />
</Frame>

## Reading the charts

Each chart shows:

* **Total count** in the header (e.g., "Requests: 11")
* **Purple bar chart** with dates on the X axis
* **Date range picker** (calendar icon) in the top right to filter the period

The date range defaults to the current month. Switch to a wider range to see trends, or narrow to a specific day to investigate a spike.

## Investigate a spike

When a chart shows an unexpected jump:

1. Note the date of the spike in the relevant chart
2. Switch to [Threads](/guides/observability/threads) and look for threads created on that date
3. Check whether the spike is concentrated on one trigger type or spread across sources
4. If the API calls chart also spiked, check whether an agent node called the same tool repeatedly (possible loop or retry issue)
5. If only input tokens spiked, check whether conversation history or memory is accumulating without bounds

## Cost optimization

The token charts are the most actionable for cost control:

* High **input tokens** relative to output may mean you're sending too much context. Consider adding a Summarizer node before expensive Agent nodes to compress the input.
* If a particular day shows a token spike, cross-reference with the [Threads](/guides/observability/threads) tab to find which execution consumed the most.
* Compare token usage before and after switching a node to a cheaper model tier (T2 or T3) to confirm the savings. Use the [tier guidance](/guides/agentic-automation/multi-model-reasoning#pick-the-right-tier-for-the-task) to decide which nodes can safely move down without affecting output quality.

## What's next

<CardGroup cols={2}>
  <Card title="Threads" icon="messages" href="/guides/observability/threads">
    Trace the full execution log to find where a run went wrong.
  </Card>

  <Card title="Task Monitoring" icon="list-check" href="/guides/observability/tasks">
    Scan executions by status and triage failures across agents.
  </Card>
</CardGroup>
