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

# List sessions

> **Auth:** organization API key (`read` scope or higher) or a signed-in user.

Filter with `proxy_id`, `status`, `search`, `from` and `to`.



## OpenAPI

````yaml https://cp.xenovia.io/openapi.json get /api/v1/sessions
openapi: 3.1.0
info:
  title: Xenovia Control Plane API
  version: 1.0.0
  description: >-
    Management API for proxies, providers, policies, telemetry, alerts and
    organization settings.
servers:
  - url: https://cp.xenovia.io
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v1/sessions:
    get:
      tags:
        - sessions
      summary: List sessions
      description: >-
        **Auth:** organization API key (`read` scope or higher) or a signed-in
        user.


        Filter with `proxy_id`, `status`, `search`, `from` and `to`.
      operationId: list_sessions_route_api_v1_sessions_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            default: 20
            title: Limit
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            default: 0
            title: Offset
        - name: proxy_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Proxy Id
        - name: status
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/SessionStatus'
              - type: 'null'
            title: Status
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                maxLength: 255
                minLength: 1
              - type: 'null'
            title: Search
        - name: from
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: From
        - name: to
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: To
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PaginatedResponse_SessionSummary_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    SessionStatus:
      type: string
      enum:
        - allowed
        - blocked
        - escalated
        - error
        - running
        - incomplete
      title: SessionStatus
    PaginatedResponse_SessionSummary_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/SessionSummary'
          type: array
          title: Items
        total:
          type: integer
          title: Total
        limit:
          type: integer
          title: Limit
        offset:
          type: integer
          title: Offset
      type: object
      required:
        - items
        - total
        - limit
        - offset
      title: PaginatedResponse[SessionSummary]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SessionSummary:
      properties:
        session_id:
          type: string
          title: Session Id
        type:
          type: string
          title: Type
          default: session
        status:
          $ref: '#/components/schemas/SessionStatus'
        proxy:
          $ref: '#/components/schemas/SessionProxy'
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        calls:
          type: integer
          title: Calls
        turns:
          type: integer
          title: Turns
        steps:
          type: integer
          title: Steps
        policy_blocks:
          type: integer
          title: Policy Blocks
        tokens:
          $ref: '#/components/schemas/SessionTokenUsage'
        cost:
          anyOf:
            - $ref: '#/components/schemas/SessionCost'
            - type: 'null'
        started_at:
          type: string
          format: date-time
          title: Started At
        ended_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Ended At
        last_activity_at:
          type: string
          format: date-time
          title: Last Activity At
        terminal_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Terminal Reason
      type: object
      required:
        - session_id
        - status
        - proxy
        - calls
        - turns
        - steps
        - policy_blocks
        - tokens
        - started_at
        - last_activity_at
      title: SessionSummary
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    SessionProxy:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        name:
          type: string
          title: Name
      type: object
      required:
        - id
        - name
      title: SessionProxy
    SessionTokenUsage:
      properties:
        input:
          type: integer
          title: Input
          default: 0
        output:
          type: integer
          title: Output
          default: 0
        total:
          type: integer
          title: Total
          default: 0
      type: object
      title: SessionTokenUsage
    SessionCost:
      properties:
        amount:
          type: string
          title: Amount
        currency:
          type: string
          title: Currency
      type: object
      required:
        - amount
        - currency
      title: SessionCost
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        Bearer token: an organization API key (`ak_…`) created under Settings →
        API Keys, or a dashboard user session token. Proxy keys (`xe_…`) are not
        accepted here. Endpoints marked as user-only in their description reject
        organization keys with `403`.

````