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

# Query API

> Trace query API reference

Query traces and retrieve analytics.

***

## List Traces

```
GET /api/traces
```

**Parameters:**

| Parameter   | Type    | Description                |
| ----------- | ------- | -------------------------- |
| `service`   | string  | Filter by service          |
| `limit`     | int     | Max results (default: 100) |
| `offset`    | int     | Pagination offset          |
| `startDate` | ISO8601 | Start time                 |
| `endDate`   | ISO8601 | End time                   |

**Example:**

```bash theme={null}
curl "http://localhost:8081/api/traces?service=chat-api&limit=10"
```

***

## Get Trace

```
GET /api/traces/:id
```

**Example:**

```bash theme={null}
curl "http://localhost:8081/api/traces/trace_abc123"
```

***

## Cost Analytics

```
GET /api/analytics/cost
```

**Parameters:**

| Parameter   | Type    | Description               |
| ----------- | ------- | ------------------------- |
| `service`   | string  | Filter by service         |
| `startDate` | ISO8601 | Start time                |
| `endDate`   | ISO8601 | End time                  |
| `groupBy`   | string  | Group by (model, service) |
