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

# Usage Analytics

> Time-binned run counts, user counts, and duration percentiles for a project.

Only **project admins** can call this endpoint. Each response returns at most **1440** time bins; there is no pagination. You may omit `group_by`, `from`, and/or `to` — the server applies defaults — and the JSON body includes `group_by`, `from`, and `to` so you can see the bin size and range that were actually used.


## OpenAPI

````yaml GET /orgs/{org_id}/projects/{project_id}/analytics/usage
openapi: 3.1.0
info:
  title: Timbal Platform API
  description: Public API documentation for the Timbal platform
  license:
    name: ''
  version: 2.0.0
servers:
  - url: https://api.timbal.ai
    description: Production
  - url: https://api.dev.timbal.ai
    description: Development
security: []
tags:
  - name: ace
    description: Action Control Engine (ACE) operations
  - name: analytics
    description: Project analytics
  - name: billing
    description: Subscriptions, usage, and payment-related operations
  - name: content
    description: Re-sign stored content URLs
  - name: files
    description: File operations
  - name: iam
    description: IAM — actions, roles, users, and authorization introspection
  - name: k2
    description: Knowledge Bases v2 operations
  - name: orgs
    description: Organization operations
  - name: projects
    description: Project operations
  - name: runs
    description: Execution operations
  - name: templates
    description: Public project template catalog
  - name: users
    description: Authenticated user profile
paths:
  /orgs/{org_id}/projects/{project_id}/analytics/usage:
    get:
      tags:
        - analytics
      description: >-
        Time-binned run counts, user counts, and duration percentiles for a
        project.
      operationId: handler
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
        - name: project_id
          in: path
          required: true
          schema:
            type: string
        - name: group_by
          in: query
          description: Bucket size for aggregation (`minute`, `hour`, or `day`).
          required: false
          schema:
            $ref: '#/components/schemas/BinSize'
        - name: from
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int64
        - name: to
          in: query
          required: false
          schema:
            type:
              - integer
              - 'null'
            format: int64
        - name: user_id
          in: query
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: Usage analytics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectAnalyticsUsageBody'
        '400':
          description: Bad request
        '403':
          description: Forbidden
        '500':
          description: Error
      security:
        - bearer_auth: []
components:
  schemas:
    BinSize:
      type: string
      enum:
        - minute
        - hour
        - day
    ProjectAnalyticsUsageBody:
      type: object
      required:
        - group_by
        - from
        - to
        - bins
      properties:
        bins:
          type: array
          items:
            $ref: '#/components/schemas/UsageBin'
        from:
          type: integer
          format: int64
        group_by:
          $ref: '#/components/schemas/BinSize'
        to:
          type: integer
          format: int64
    UsageBin:
      type: object
      required:
        - interval_starts_at
        - interval_ends_at
        - n_success
        - n_error
        - n_running
        - n_timeout
        - n_users
      properties:
        interval_ends_at:
          type: integer
          format: int64
        interval_starts_at:
          type: integer
          format: int64
        n_error:
          type: integer
          format: int64
        n_running:
          type: integer
          format: int64
        n_success:
          type: integer
          format: int64
        n_timeout:
          type: integer
          format: int64
        n_users:
          type: integer
          format: int64
        p50:
          type:
            - number
            - 'null'
          format: double
        p90:
          type:
            - number
            - 'null'
          format: double
        p95:
          type:
            - number
            - 'null'
          format: double
        p99:
          type:
            - number
            - 'null'
          format: double
  securitySchemes:
    bearer_auth:
      type: http
      scheme: bearer
      description: >-
        Timbal API key. Obtain your API key from the Timbal platform settings.
        See [Authentication](/api-reference/authentication) for more
        information.

````