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

# Computer Usage Analytics

> Returns your organization's Computer usage analytics as a bucketed time series for a single dataset. Requires an organization analytics API key, generated by an org admin from Settings → Organization → Computer in the Perplexity web app. Only complete UTC grid buckets are returned: start_time snaps down to its bucket, and the in-progress bucket is never included.

<Info>
  This endpoint requires an **organization analytics API key**, generated by an org admin from the Perplexity web app — not a regular Sonar API key. See [Computer Analytics API](/docs/admin/computer-analytics-api) for setup, time-window semantics, and pagination.
</Info>


## OpenAPI

````yaml get /v1/analytics/computer/usage
openapi: 3.1.0
info:
  title: Perplexity AI API
  description: Perplexity AI API
  version: 1.0.0
servers:
  - url: https://api.perplexity.ai
    description: Perplexity AI API
security: []
paths:
  /v1/analytics/computer/usage:
    get:
      summary: Computer Usage Analytics
      description: >-
        Returns your organization's Computer usage analytics as a bucketed time
        series for a single dataset. Requires an organization analytics API key,
        generated by an org admin from Settings → Organization → Computer in the
        Perplexity web app. Only complete UTC grid buckets are returned:
        start_time snaps down to its bucket, and the in-progress bucket is never
        included.
      operationId: getComputerUsageAnalytics
      parameters:
        - name: dataset
          in: query
          required: true
          description: The dataset to query.
          schema:
            type: string
            enum:
              - credit_usage
              - connectors
              - artifacts
              - skills
              - spaces
              - workflows
              - task_durations
        - name: start_time
          in: query
          required: true
          description: >-
            Window start in unix seconds (UTC), inclusive. Snapped down to the
            bucket grid, so the first bucket can include usage from before this
            time.
          schema:
            type: integer
            minimum: 0
        - name: end_time
          in: query
          required: false
          description: >-
            Window end in unix seconds (UTC), exclusive. Defaults to now; future
            values are capped at now. The window may span at most 90 days.
          schema:
            type: integer
            minimum: 0
        - name: bucket_width
          in: query
          required: false
          description: Bucket size. Buckets align to the UTC grid.
          schema:
            type: string
            enum:
              - 1d
              - 1h
            default: 1d
        - name: limit
          in: query
          required: false
          description: 'Buckets per page. 1d: default 7, max 31. 1h: default 24, max 168.'
          schema:
            type: integer
        - name: page
          in: query
          required: false
          description: >-
            Opaque pagination cursor from a previous response's next_page. Valid
            only with the same query parameters it was issued for.
          schema:
            type: string
        - name: user_email
          in: query
          required: false
          description: >-
            Restrict results to a single member of your organization. Emails
            that don't match a current member return a generic 400.
          schema:
            type: string
            format: email
      responses:
        '200':
          description: >-
            Bucketed usage for the requested window. Buckets without data carry
            count 0; the analytics store syncs periodically, so a zero in a
            recent bucket can mean the data hasn't synced yet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ComputerUsageResponse'
              example:
                categories:
                  - Model
                  - Credit Source
                data:
                  - start_time: 1746057600
                    end_time: 1746144000
                    count: 350
                    by_categories:
                      Model:
                        - category: claude-opus-4-8
                          count: 210
                        - category: claude-sonnet-4-6
                          count: 120
                      Credit Source:
                        - category: paid
                          count: 250
                        - category: promo
                          count: 80
                has_more: false
                next_page: null
        '400':
          description: >-
            Invalid parameters (type: bad_request) or semantically invalid
            request (type: invalid_request) — e.g. start_time after end_time, a
            window over 90 days, a misused pagination cursor, or a user_email
            that doesn't match a member of the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsErrorResponse'
              example:
                error:
                  message: start_time must be before end_time.
                  type: invalid_request
                  code: 400
        '401':
          description: 'Missing or invalid API key (type: unauthorized).'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsErrorResponse'
        '404':
          description: >-
            The Computer Analytics API is not enabled for this organization
            (type: feature_disabled).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsErrorResponse'
        '429':
          description: >-
            Rate limit exceeded (type: request_rate_limit_exceeded). Limits
            apply per organization across all of its keys.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AnalyticsErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    ComputerUsageResponse:
      type: object
      properties:
        categories:
          type: array
          description: >-
            Category breakdown labels the requested dataset surfaces, in
            canonical render order. Each label is a key in every bucket's
            `by_categories`.
          items:
            type: string
        data:
          type: array
          description: >-
            Every bucket in the page's window, in chronological order. Buckets
            without data carry count 0 and an empty breakdown.
          items:
            $ref: '#/components/schemas/ComputerUsageBucket'
        has_more:
          type: boolean
          description: >-
            Whether more buckets exist beyond this page. False also when the
            window's remaining buckets are past the current data frontier.
        next_page:
          type:
            - string
            - 'null'
          description: >-
            Cursor for the next page; pass as the page parameter with otherwise
            identical query parameters.
      required:
        - categories
        - data
        - has_more
    AnalyticsErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            type:
              type: string
            code:
              type: integer
          required:
            - message
            - type
            - code
      required:
        - error
    ComputerUsageBucket:
      type: object
      properties:
        start_time:
          type: integer
          description: Bucket start in unix seconds (UTC), inclusive.
        end_time:
          type: integer
          description: Bucket end in unix seconds (UTC), exclusive.
        count:
          type: integer
          description: >-
            Bucket total. For credit_usage this may exceed the sum of any single
            breakdown — usage without a category attribution counts toward the
            total but not the breakdown.
        by_categories:
          type: object
          description: >-
            Category breakdowns for this bucket, keyed by the labels declared in
            the response's top-level `categories` list. An empty list means the
            bucket has no data for that breakdown.
          additionalProperties:
            type: array
            items:
              $ref: '#/components/schemas/ComputerUsageCategoryCount'
      required:
        - start_time
        - end_time
        - count
        - by_categories
    ComputerUsageCategoryCount:
      type: object
      description: >-
        A bucket's count for one value of a category breakdown — e.g. a
        connector name for connectors, a duration band for task_durations, or
        paid/promo for credit_usage's Credit Source axis.
      properties:
        category:
          type: string
        count:
          type: integer
      required:
        - category
        - count
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````