---
title: "List agent session traces"
method: GET
path: "/agents/sessions/{session_id}/traces"
tags: ["Agents"]
---

# List agent session traces

`GET /agents/sessions/{session_id}/traces`

## Request

- Base URL: `https://api.openai.com/v1`
- URL: `https://api.openai.com/v1/agents/sessions/{session_id}/traces`
- Auth: HTTP bearer

Lists published root-turn traces as OTLP JSON, ordered by turn creation time and ID. Unpublished traces are skipped. Each page returns data available when read; it does not wait for late traces. Trace reads and the JSON response are limited to 16 MiB per request. If the limit is exceeded, request fewer traces.

## Path parameters

- `session_id` string, required

## Query parameters

- `limit` integer
- `order` 'asc' | 'desc': The order in which paginated resources are returned.
- `after` string

## Response `200`

A page of published session traces.

- SessionTraceListResource: A page of Agents API resources, with IDs for retrieving additional pages.
  - `object` 'list', required: The object type, which is always `list`.
  - `data` SessionTurnTraceResource[], required: The resources returned in this page, in the requested sort order.
    - `id` string, required: The root turn ID. Use this ID as the pagination anchor.
    - `object` 'agent.session.trace', required: The object type, which is always `agent.session.trace`.
    - `session_id` string, required: The session that owns this trace.
    - `created_at` integer, required: The Unix timestamp in seconds when the root turn was created.
    - `otlp` object, required: An OTLP JSON ExportTraceServiceRequest containing resourceSpans. Only currently published data is returned; later trace updates are not awaited.
  - `first_id` string, nullable, required: The ID of the first resource in `data`, or `null` if the page is empty.
  - `last_id` string, nullable, required: The ID of the last resource in `data`, or `null` if the page is empty. Pass this as `after` with the same order and filters.
  - `has_more` boolean, required: Whether there are more resources to retrieve after this page.

## Other responses

- `400`: The request was invalid.
- `401`: Authentication or project context was missing.
- `403`: The API key lacks the required permission.
- `404`: The requested session or event was not found.
- `409`: The request conflicted with the current session state.
- `500`: An internal error occurred.
- `503`: The service is temporarily unavailable.

## Changes

- **2026-10-05** `7f654af7f94f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/omnistack-sh/apis/openai-api/changes/agents/sessions/:session_id/traces/get.md)

---

[API](https://skmtc.dev/omnistack-sh/apis/openai-api.md) - [All operations](https://skmtc.dev/omnistack-sh/apis/openai-api/llms.txt) - [OpenAPI document](https://skmtc.dev/omnistack-sh/apis/openai-api/revisions/0a26f104d35f?raw)
