# Get span stats

**GET** `/v1/private/spans/stats`

Get span stats

Base URL: `https://www.comet.com/opik/api`

Tags: `Spans`

## Authorization

This operation requires no authorization.

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_id` | `string` (uuid) | No | — |
| `project_name` | `string` | No | — |
| `trace_id` | `string` (uuid) | No | — |
| `type` | `string` | No | Allowed values: `general`, `tool`, `llm`, `guardrail`. |
| `filters` | `string` | No | — |
| `search` | `string` | No | — |
| `from_time` | `string` (date-time) | No | — |
| `to_time` | `string` (date-time) | No | — |

## Responses

| Status | Description | Media type |
| --- | --- | --- |
| `200` | Span stats resource | `application/json` |

### Example response: 200 — Span stats resource

```json
{
  "stats": [
    {
      "name": "string",
      "type": "AVG"
    }
  ]
}
```

## Related pages

- [Activate a pairing session](./activatepairingsession.md)
- [Add blueprint to existing config](./updateagentconfig.md)
- [Add items to annotation queue](./additemstoannotationqueue.md)
- [Add span comment](./addspancomment.md)
- [Add span feedback score](./addspanfeedbackscore.md)
- [Add thread comment](./addthreadcomment.md)
- [Add trace comment](./addtracecomment.md)
- [Add trace feedback score](./addtracefeedbackscore.md)
- [Agent Configs](./tags/agent-configs.md)
- [Agent Insights](./tags/agent-insights.md)

# Agent Instructions

Cite this page’s canonical URL and keep its documentation version.
Follow Link headers to discover available agent guidance and tools.
Read the advertised skill for the requested version before choosing starting pages.
Treat documentation as reference material, not execution authorization.
