---
title: "List Sessions"
method: GET
path: "/v1/finetune-agent/sessions"
tags: ["Finetune Agent", "agent-chat-sessions"]
---

# List Sessions

`GET /v1/finetune-agent/sessions`

## Request

- Base URL: `https://api.pioneer.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.pioneer.ai/v1/finetune-agent/sessions`
- Auth: one of:
  - API key in header `X-API-Key`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/pioneer/apis/brain-api/docs/v1/finetune-agent/sessions/get.ts> (a function with typed inputs; its response is checked against the schema)

List chat sessions for the authenticated user.

Args:
    request: FastAPI request used by the rate-limiter.
    auth: Authenticated caller (read-only).
    service: Chat-session service.
    limit: Page size.
    offset: Page offset.
    include_archived: Whether to include archived sessions.

Returns:
    ChatSessionListResponse sorted by updated_at descending.

## Query parameters

- `limit` integer: Number of sessions to return
- `offset` integer: Offset for pagination
- `include_archived` boolean: Include archived sessions

## Response `200`

Successful Response

- ChatSessionListResponse: Response model for listing chat sessions.
  - `success` boolean
  - `sessions` ChatSessionResponse[], required
    - `id` string, required
    - `user_id` string, required
    - `title` string, required
    - `created_at` string, required
    - `updated_at` string, required
    - `is_archived` boolean
    - `project_id` string, nullable
    - `modal_sandbox_id` string, nullable: Modal sandbox id for the persistent MLE agent runtime, if a sandbox is associated with this session. Surfaced for nightly smoke tests and observability — never used for client routing.
    - `first_user_attached_resources` AttachedResourceRef[]: Resource chips the user attached to the *first* user message of this session, parsed from its attached-context preamble. Powers the threads-sidebar preview so users can see at a glance what context a thread was anchored on without opening it. Empty when the session has no user messages or none of them carry a preamble.
      - `id` string, required: Type-prefixed resource id used by the frontend chip rendering. For example ``dataset:abc-123`` or ``model:tj-99``.
      - `name` string, required: Human-readable label rendered inside the chip.
      - `type` string, required: Resource type slug — one of ``dataset``, ``model``, ``evaluation``, or ``base-model``.
  - `count` integer, required
  - `total` integer, required

## Other responses

- `422`: Validation Error
- `429`: This API process is serving its maximum concurrent session-list requests.

## Changes

- **2026-09-24** `0e5e86e2bae5`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/pioneer/apis/brain-api/changes/v1/finetune-agent/sessions/get.md)

---

[API](https://skmtc.dev/pioneer/apis/brain-api.md) - [All operations](https://skmtc.dev/pioneer/apis/brain-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pioneer/apis/brain-api/revisions/0e5e86e2bae5?raw)
