---
title: "Get Session"
method: GET
path: "/api/v1/public/sessions/{session_id}"
tags: ["Sessions"]
---

# Get Session

`GET /api/v1/public/sessions/{session_id}`

## Request

- Base URL: `https://app.traceroot.ai`
- URL: `https://app.traceroot.ai/api/v1/public/sessions/{session_id}`
- Auth: HTTP bearer

Get one session with all its traces for the key's project.

Retention uses the silent list-style clamp rather than a 403: a session
that contains traces older than the plan window degrades to showing only
the in-window traces instead of failing outright.

Args:
    auth (DualStampedAuth): Resolved credential context (API key or user
        session token); scopes the read to its project and stamps the
        rate-limit identity.
    session_id (str): Session to fetch.
    start_after (datetime | None): Inclusive lower bound on trace time.
    end_before (datetime | None): Exclusive upper bound on trace time.

Returns:
    SessionDetailResponse: The session overview and its traces.

Raises:
    HTTPException: 404 if the session is missing or outside the key's
        project, 500 on a reader failure.

## Path parameters

- `session_id` string, required

## Query parameters

- `start_after` string, date-time, nullable: Only traces at or after this time (inclusive, ISO 8601)
- `end_before` string, date-time, nullable: Only traces before this time (exclusive, ISO 8601)
- `project_id` string, nullable: Target project for the request. Required when authenticating with a user session token (a user credential is only meaningful scoped to a project); for an API key it is optional and, if given, must match the key's project.

## Response `200`

Successful Response

- SessionDetailResponse: Session detail with all traces for conversation view.
  - `duration_ms` number, nullable, required
  - `first_trace_time` string, date-time, nullable, required
  - `last_trace_time` string, date-time, nullable, required
  - `session_id` string, required
  - `total_cost` number, nullable
  - `total_input_tokens` integer, nullable, required
  - `total_output_tokens` integer, nullable, required
  - `trace_count` integer, required
  - `traces` SessionTraceItem[], required
    - `duration_ms` number, nullable, required
    - `input` string, nullable, required
    - `name` string, required
    - `output` string, nullable, required
    - `status` string, required
    - `trace_id` string, required
    - `trace_start_time` string, date-time, required
    - `user_id` string, nullable, required
  - `user_ids` string[], required

## Other responses

- `401`: Authentication failed
- `404`: Session not found
- `422`: Validation Error
- `500`: Failed to get session
- `503`: Authentication service unavailable

---

[API](https://skmtc.dev/traceroot/apis/traceroot-public-api.md) - [All operations](https://skmtc.dev/traceroot/apis/traceroot-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/traceroot/apis/traceroot-public-api/revisions/ce6aef96c0d6?raw)
