Sessions

Get Session

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.

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

Path parameters

session_idstring required

Query parameters

start_afterstring date-time nullable

Only traces at or after this time (inclusive, ISO 8601)

end_beforestring date-time nullable

Only traces before this time (exclusive, ISO 8601)

project_idstring 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

Successful Response

duration_msnumber nullable required
first_trace_timestring date-time nullable required
last_trace_timestring date-time nullable required
session_idstring required
total_costnumber nullable
total_input_tokensinteger nullable required
total_output_tokensinteger nullable required
trace_countinteger required
user_idsstring[] required

Changes

No recorded changes to this operation across all 1 revision of this API.