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

# AI Observability API

> Query AI dashboard stats, histograms, sessions, users, and hosted fix activity.

Use the AI Observability API for aggregate dashboard views over LLM requests, costs, latency, sessions, users, and hosted fix activity. Use [Agent Observations API](/api-reference/agent-observations) for row-level generation, tool-call, retrieval, and agent-step evidence.

## Operations

| Operation        | Method and path                                          | Purpose                                                 |
| ---------------- | -------------------------------------------------------- | ------------------------------------------------------- |
| `ai.stats`       | `GET /v1/projects/{project_id}/ai/stats`                 | Aggregate AI request and session stats.                 |
| `ai.histogram`   | `GET /v1/projects/{project_id}/ai/histogram`             | Request, cost, latency, and token buckets over time.    |
| `ai.getSession`  | `GET /v1/projects/{project_id}/ai/sessions/{session_id}` | Session drill-down.                                     |
| `ai.getUser`     | `GET /v1/projects/{project_id}/ai/users/{user_id}`       | User drill-down, optionally bounded by `from` and `to`. |
| `ai.fixStats`    | `GET /v1/projects/{project_id}/ai/fixes/stats`           | Hosted fix request and completion breakdowns.           |
| `ai.fixTimeline` | `GET /v1/projects/{project_id}/ai/fixes/timeline`        | Hosted fix dispatch and completion counts over time.    |

Keep dashboard queries bounded by time when supported. Use observation filters when you need the exact prompt, output, tool call, token count, or cost row.

## CLI and MCP

Use `squasher ai ...`, `squasher agent-observations ...`, or `squasher fixes ...` depending on the workflow. In MCP Code Mode, call `search("ai")` or `search("agentObservations")` first.

## Agent handoff

```text theme={null}
Analyze AI usage for Squasher project <project_id>. Start with ai.stats or ai.histogram, then drill into ai.getSession, ai.getUser, or agentObservations only when a concrete session, user, model, tool, or cost spike is identified. Return ids, timestamps, model/provider names, tokens, costs, and latency.
```

Related: [AI observability](/features/ai-observability), [Agent SDK](/sdks/agent).
