> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flintai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# List LLM sessions grouped by session_id for an agent

> Returns paginated LLM sessions aggregated by session_id with tokens, cost, turns, duration, and guardrail results



## OpenAPI

````yaml /flintai/api-reference/openapi.json get /aispm-llm-sessions/tenants/{tenant_id}/workspaces/{workspace_id}
openapi: 3.0.3
info:
  contact: {}
  description: Flint AI Platform API
  license:
    name: Flint AI
    url: https://www.sandboxaq.com/legal/eula
  title: Flint AI Platform API
  version: 1.0.0
servers:
  - description: Flint AI Platform (per-tenant instance)
    url: https://{instance}.flintai.dev/api/v1
    variables:
      instance:
        default: your-instance
        description: Your Flint AI instance subdomain
security: []
paths:
  /aispm-llm-sessions/tenants/{tenant_id}/workspaces/{workspace_id}:
    get:
      tags:
        - aispm-llm-sessions
      summary: List LLM sessions grouped by session_id for an agent
      description: >-
        Returns paginated LLM sessions aggregated by session_id with tokens,
        cost, turns, duration, and guardrail results
      operationId: GetAispmLlmSessions
      parameters:
        - description: Tenant ID
          in: path
          name: tenant_id
          required: true
          schema:
            type: string
        - description: Workspace ID
          in: path
          name: workspace_id
          required: true
          schema:
            type: string
        - description: Agent ID to filter sessions
          in: query
          name: agent_id
          required: true
          schema:
            type: string
        - description: >-
            Column to sort by (session_id, time, tokens, cost, turns,
            duration_ms)
          in: query
          name: sort
          schema:
            type: string
        - description: 'Sort direction: asc or desc'
          in: query
          name: sort_dir
          schema:
            type: string
        - description: Pagination cursor from previous response
          in: query
          name: cursor
          schema:
            type: string
        - description: Number of results per page (default 10, max 10000)
          in: query
          name: pageSize
          schema:
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/engine_output.EngineDataPage'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.RequestError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.RequestError'
          description: Unauthorized
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/common.RequestError'
          description: Internal Server Error
      security:
        - BearerAuth: []
components:
  schemas:
    engine_output.EngineDataPage:
      properties:
        cursor:
          type: string
        header:
          items:
            type: string
          type: array
        rows:
          items:
            items: {}
            type: array
          type: array
        total:
          type: integer
        total_sampling:
          type: number
      required:
        - cursor
        - header
        - rows
      type: object
    common.RequestError:
      description: Error responses returned by the API
      properties:
        code:
          example: 400
          type: integer
        message:
          example: Invalid request
          type: string
      required:
        - code
        - message
      type: object
  securitySchemes:
    BearerAuth:
      description: Use this header with a Bearer token to authenticate requests.
      in: header
      name: Authorization
      type: apiKey

````