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

# Get Sessions History

> Retrieves session usage analytics for the authenticated team.



## OpenAPI

````yaml /openapi.yaml get /v1/sessions/history
openapi: 3.1.0
info:
  title: AnchorBrowser API
  version: 1.0.0
  description: APIs to manage all browser-related actions and configuration.
servers:
  - url: https://api.anchorbrowser.io
    description: API server
security: []
paths:
  /v1/sessions/history:
    get:
      tags:
        - Browser Sessions
      summary: Get Sessions History
      description: Retrieves session usage analytics for the authenticated team.
      parameters:
        - in: query
          name: from_date
          required: false
          description: Start date for filtering (ISO 8601 format).
          schema:
            type: string
            format: date-time
        - in: query
          name: to_date
          required: false
          description: End date for filtering (ISO 8601 format).
          schema:
            type: string
            format: date-time
        - in: query
          name: granularity
          required: false
          description: Time granularity for aggregation.
          schema:
            type: string
            enum:
              - hour
              - day
              - week
              - month
            default: day
        - in: query
          name: metrics
          required: false
          description: Metrics to include in the response.
          schema:
            oneOf:
              - type: string
              - type: array
                items:
                  type: string
                  enum:
                    - session_count
                    - proxy_bytes
                    - ai_steps
                    - session_hours
                    - credits_used
                    - screenshots
                    - network_bytes_total
            default:
              - session_count
        - in: query
          name: page
          required: false
          description: Page number for pagination.
          schema:
            type: integer
            minimum: 1
            default: 1
        - in: query
          name: limit
          required: false
          description: Number of records per page.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
      responses:
        '200':
          description: Session history analytics retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SessionHistoryResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - api_key_header: []
components:
  schemas:
    SessionHistoryResponse:
      type: object
      properties:
        data:
          type: array
          description: Historical data points.
          items:
            $ref: '#/components/schemas/SessionHistoryDataPoint'
        summary:
          $ref: '#/components/schemas/SessionHistorySummary'
        pagination:
          $ref: '#/components/schemas/SessionHistoryPagination'
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: integer
            message:
              type: string
    SessionHistoryDataPoint:
      type: object
      properties:
        date:
          type: string
          description: Date/time period for this data point.
        session_count:
          type: number
          description: Number of sessions created in this period.
        proxy_bytes:
          type: number
          description: Total proxy bytes used in this period.
        ai_steps:
          type: number
          description: Total AI steps taken in this period.
        session_hours:
          type: number
          description: Total session hours in this period (duration/3600).
        credits_used:
          type: number
          description: Total credits used in this period.
        screenshots:
          type: number
          description: Total screenshots taken in this period.
        network_bytes_total:
          type: number
          description: Total network bytes sent and received in this period.
    SessionHistorySummary:
      type: object
      properties:
        total_sessions:
          type: number
          description: Total number of sessions in the time range.
        total_proxy_bytes:
          type: number
          description: Total proxy bytes used in the time range.
        total_ai_steps:
          type: number
          description: Total AI steps taken in the time range.
        total_session_hours:
          type: number
          description: Total session hours in the time range.
        total_credits_used:
          type: number
          description: Total credits used in the time range.
        total_screenshots:
          type: number
          description: Total screenshots taken in the time range.
        total_network_bytes_total:
          type: number
          description: Total network bytes sent and received in the time range.
    SessionHistoryPagination:
      type: object
      properties:
        current_page:
          type: integer
        total_pages:
          type: integer
        total_records:
          type: integer
        has_next:
          type: boolean
        has_prev:
          type: boolean
  securitySchemes:
    api_key_header:
      type: apiKey
      in: header
      name: anchor-api-key
      description: API key passed in the header

````