---
title: "Get recent session data"
method: GET
path: "/api/{org_id}/{stream_name}/traces/session"
tags: ["Traces"]
---

# Get recent session data

`GET /api/{org_id}/{stream_name}/traces/session`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/{org_id}/{stream_name}/traces/session`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/:org_id/:stream_name/traces/session/get.ts> (a function with typed inputs; its response is checked against the schema)

Retrieves the most recent LLM session data from a specific trace stream within a time range. Sessions group multiple traces that share the same session ID. Returns session summaries including session IDs, trace counts, LLM usage statistics, cost, and timing information.

## Path parameters

- `org_id` string, required
- `stream_name` string, required

## Query parameters

- `filter` string
- `keyword` string
- `from` integer, required
- `size` integer, required
- `start_time` integer, required
- `end_time` integer, required
- `timeout` integer
- `sort_by` string
- `sort_order` string

## Response `200`

Success

- LatestSessionsResponse: Session-list pagination deliberately avoids an exact count query because counting every distinct session is more expensive than fetching one page. `total` is therefore a lower bound while `has_more` is true, and becomes exact on the final page.
  - `from` integer, required
  - `function_error` string
  - `has_more` boolean, required
  - `hits` object[], required
  - `size` integer, required
  - `took` integer, required
  - `total` integer, required
  - `trace_id` string

## Other responses

- `400`: Failure
- `500`: Failure

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
