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

# Get Analytics

> Time-series analytics for traces.

Auth: `Bearer` + `X-Project-ID` | `X-API-Key` + `X-Project-Name`



## OpenAPI

````yaml /openapi.json get /traces/analytics
openapi: 3.1.0
info:
  title: PandaProbe API
  description: >-
    Open-source agent engineering platform — trace LLM calls, evaluate agent
    performance, and monitor AI pipelines.
  version: 0.1.0
  contact:
    name: PandaProbe
    url: https://www.pandaprobe.com
    email: support@pandaprobe.com
servers:
  - url: https://api.pandaprobe.com
    description: Production
security: []
tags:
  - name: health
    description: Service health and readiness probes.
  - name: user
    description: Authenticated user profile.
  - name: traces
    description: Trace ingestion, querying, updating, and analytics.
  - name: sessions
    description: Session-based trace aggregation and analytics.
  - name: evaluations
    description: Evaluation runs, scores, analytics, and monitoring.
  - name: organizations
    description: Organization management and membership.
  - name: projects
    description: Project CRUD within organizations.
  - name: api-keys
    description: API key lifecycle management.
paths:
  /traces/analytics:
    get:
      tags:
        - traces
      summary: Get Analytics
      description: |-
        Time-series analytics for traces.

        Auth: `Bearer` + `X-Project-ID` | `X-API-Key` + `X-Project-Name`
      operationId: get_analytics_traces_analytics_get
      parameters:
        - name: metric
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AnalyticsMetric'
            default: volume
        - name: granularity
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/AnalyticsGranularity'
            default: day
        - name: started_after
          in: query
          required: true
          schema:
            type: string
            format: date-time
            title: Started After
        - name: started_before
          in: query
          required: true
          schema:
            type: string
            format: date-time
            title: Started Before
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                anyOf:
                  - type: array
                    items:
                      $ref: '#/components/schemas/AnalyticsBucket'
                  - type: array
                    items:
                      $ref: '#/components/schemas/TokenCostBucket'
                  - type: array
                    items:
                      $ref: '#/components/schemas/TopModel'
                title: Response Get Analytics Traces Analytics Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
        - ApiKey: []
        - ProjectID: []
        - ProjectName: []
components:
  schemas:
    AnalyticsMetric:
      type: string
      enum:
        - volume
        - errors
        - latency
        - cost
        - tokens
        - models
      title: AnalyticsMetric
      description: Available metric types for the analytics endpoint.
    AnalyticsGranularity:
      type: string
      enum:
        - hour
        - day
        - week
      title: AnalyticsGranularity
      description: Time-bucket granularity for analytics queries.
    AnalyticsBucket:
      properties:
        bucket:
          type: string
          title: Bucket
        trace_count:
          type: integer
          title: Trace Count
          default: 0
        error_count:
          type: integer
          title: Error Count
          default: 0
        avg_latency_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Avg Latency Ms
        p50_latency_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: P50 Latency Ms
        p90_latency_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: P90 Latency Ms
        p99_latency_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: P99 Latency Ms
      type: object
      required:
        - bucket
      title: AnalyticsBucket
      description: Time-bucketed trace volume, error, and latency statistics.
    TokenCostBucket:
      properties:
        bucket:
          type: string
          title: Bucket
        total_tokens:
          type: integer
          title: Total Tokens
          default: 0
        prompt_tokens:
          type: integer
          title: Prompt Tokens
          default: 0
        completion_tokens:
          type: integer
          title: Completion Tokens
          default: 0
        total_cost:
          type: number
          title: Total Cost
          default: 0
      type: object
      required:
        - bucket
      title: TokenCostBucket
      description: Time-bucketed token usage and cost aggregation.
    TopModel:
      properties:
        model:
          type: string
          title: Model
        call_count:
          type: integer
          title: Call Count
        total_tokens:
          type: integer
          title: Total Tokens
          default: 0
        total_cost:
          type: number
          title: Total Cost
          default: 0
      type: object
      required:
        - model
        - call_count
      title: TopModel
      description: LLM model ranked by call count within a time window.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
    ApiKey:
      type: apiKey
      in: header
      name: X-API-Key
    ProjectID:
      type: apiKey
      in: header
      name: X-Project-ID
    ProjectName:
      type: apiKey
      in: header
      name: X-Project-Name

````