---
title: "Query GenAI trace summaries — traces containing spans with `gen_ai.*` attributes."
method: GET
path: "/otel/genai/traces"
tags: ["GenAI"]
---

# Query GenAI trace summaries — traces containing spans with \`gen_ai.\*\` attributes.

`GET /otel/genai/traces`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/otel/genai/traces`
- Auth: HTTP bearer

`duration_ms` is the only field guaranteed to be milliseconds. `gen_ai.*`
span attributes (e.g. time-to-first-token, token latency) often follow the
OTel GenAI semantic conventions, which use **seconds** (a fractional
double), not milliseconds — do not read them as ms without converting.

## Query parameters

- `project_id` integer, required
- `service_name` string
- `gen_ai_system` string
- `gen_ai_model` string
- `start_time` string
- `end_time` string
- `limit` integer
- `offset` integer

## Response `200`

GenAI trace summaries

- GenAiTraceSummariesResponse
  - `data` GenAiTraceSummary[], required
    - `duration_ms` number, double, required
    - `error_count` integer, required
    - `gen_ai_model` string, nullable: The requested model from `gen_ai.request.model`.
    - `gen_ai_operation` string, nullable: The operation type from `gen_ai.operation.name` (e.g. "chat", "embeddings").
    - `gen_ai_system` string, nullable: The GenAI provider (e.g. "openai", "anthropic") from `gen_ai.provider.name`.
    - `root_span_name` string, required
    - `service_name` string, required
    - `span_count` integer, required
    - `start_time` string, date-time, required
    - `total_cache_creation_input_tokens` integer, nullable: Total cache-creation input tokens across all spans.
    - `total_cache_read_input_tokens` integer, nullable: Total cache-read input tokens across all spans.
    - `total_input_tokens` integer, nullable: Total input tokens across all spans in this trace.
    - `total_output_tokens` integer, nullable: Total output tokens across all spans in this trace.
    - `trace_id` string, required
  - `total` integer, required

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `500`: Internal server error

## Changes

- **2026-11-09** `12896146b193`: 3 breaking
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `500` status
- **2026-10-05** `4b228ebed583`: 3 info
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `403` status
  - added the optional property `status` to the response with the `500` status
- **2026-10-05** `63a80791dc58`: 3 warning
  - removed the optional property `status` from the response with the `401` status
  - removed the optional property `status` from the response with the `403` status
  - removed the optional property `status` from the response with the `500` status
- **2026-09-23** `f4efc4d5c7b7`: 3 info
  - added the optional property `status` to the response with the `401` status
  - added the optional property `status` to the response with the `403` status
  - added the optional property `status` to the response with the `500` status
- **2026-04-25** `774be20905f2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/otel/genai/traces/get.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
