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

# List agent sessions (Enterprise)

> Sessions in a time range (default the last 24 h), newest first, with the spec §6.1 filters and cursor pagination. end_user and external_id are refused here: use POST /agent-tracing/sessions/query so they stay out of URLs.



## OpenAPI

````yaml /swagger/5.16/ai-studio-swagger.yml get /agent-tracing/sessions
openapi: 3.0.1
info:
  title: Midsommar API
  description: This is the API for the Midsommar user and group management system.
  termsOfService: http://swagger.io/terms/
  contact:
    name: API Support
    url: http://www.swagger.io/support
    email: support@swagger.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: '1.0'
servers:
  - url: //localhost:8080/api/v1
security: []
paths:
  /agent-tracing/sessions:
    get:
      tags:
        - agent-tracing
      summary: List agent sessions (Enterprise)
      description: >-
        Sessions in a time range (default the last 24 h), newest first, with the
        spec §6.1 filters and cursor pagination. end_user and external_id are
        refused here: use POST /agent-tracing/sessions/query so they stay out of
        URLs.
      parameters:
        - name: from
          in: query
          description: RFC 3339 start (default 24 h before to)
          schema:
            type: string
        - name: to
          in: query
          description: RFC 3339 end (default now)
          schema:
            type: string
        - name: app_id
          in: query
          description: App
          schema:
            type: integer
        - name: user_id
          in: query
          description: Studio user
          schema:
            type: integer
        - name: session_id
          in: query
          description: Exact session id
          schema:
            type: string
        - name: agent
          in: query
          description: Agent name
          schema:
            type: string
        - name: model
          in: query
          description: Model
          schema:
            type: string
        - name: tool
          in: query
          description: Tool called
          schema:
            type: string
        - name: status
          in: query
          description: active, closed or error
          schema:
            type: string
        - name: source
          in: query
          description: declared or inferred
          schema:
            type: string
        - name: weak_links
          in: query
          description: Only sessions with weak links
          schema:
            type: boolean
        - name: has_errors
          in: query
          description: Has errors
          schema:
            type: boolean
        - name: has_gateway_events
          in: query
          description: Has gateway events
          schema:
            type: boolean
        - name: cost_min_micros
          in: query
          description: Minimum cost (micros)
          schema:
            type: integer
        - name: cost_max_micros
          in: query
          description: Maximum cost (micros)
          schema:
            type: integer
        - name: duration_min_ms
          in: query
          description: Minimum duration (ms)
          schema:
            type: integer
        - name: duration_max_ms
          in: query
          description: Maximum duration (ms)
          schema:
            type: integer
        - name: sort
          in: query
          description: >-
            started_at, cost, duration, tokens, turns, llm_calls, tool_calls or
            errors; prefix - for descending (default -started_at)
          schema:
            type: string
        - name: cursor
          in: query
          description: next_cursor of the previous page
          schema:
            type: string
        - name: limit
          in: query
          description: Page size (1-200, default 50)
          schema:
            type: integer
      responses:
        '200':
          description: '{data: [session], next_cursor}'
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api.ErrorResponse'
components:
  schemas:
    api.ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              detail:
                type: string
              title:
                type: string
      description: Error response model

````