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

# Get System Usage

> [!NOTE]
>
> **Required permission:** Admin (`admin`).


## OpenAPI

````yaml GET /admin/usage/system
openapi: 3.1.0
info:
  title: Onyx API
  description: Onyx API for AI-powered enterprise search and chat
  version: Development
servers:
  - url: https://cloud.onyx.app/api
security: []
paths:
  /admin/usage/system:
    get:
      tags:
        - public
      summary: Get System Usage
      operationId: get_system_usage
      parameters:
        - name: start
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: Start
        - name: end
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: End
        - name: model
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Model
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SystemUsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    SystemUsageResponse:
      properties:
        start:
          type: string
          title: Start
        end:
          type: string
          title: End
        categories:
          items:
            $ref: '#/components/schemas/SystemUsageCategory'
          type: array
          title: Categories
      type: object
      required:
        - start
        - end
        - categories
      title: SystemUsageResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SystemUsageCategory:
      properties:
        category:
          type: string
          title: Category
        totals:
          $ref: '#/components/schemas/UsageExportTotals'
        records:
          items:
            $ref: '#/components/schemas/SystemUsageRecord'
          type: array
          title: Records
      type: object
      required:
        - category
        - totals
        - records
      title: SystemUsageCategory
    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
    UsageExportTotals:
      properties:
        input_tokens:
          type: integer
          title: Input Tokens
        output_tokens:
          type: integer
          title: Output Tokens
        cache_read_tokens:
          type: integer
          title: Cache Read Tokens
        cache_creation_tokens:
          type: integer
          title: Cache Creation Tokens
        cost_cents:
          type: number
          title: Cost Cents
      type: object
      required:
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - cost_cents
      title: UsageExportTotals
    SystemUsageRecord:
      properties:
        attribution:
          $ref: '#/components/schemas/SystemUsageAttribution'
        model:
          type: string
          title: Model
        flow:
          type: string
          title: Flow
        provider:
          type: string
          title: Provider
        day:
          type: string
          title: Day
        input_tokens:
          type: integer
          title: Input Tokens
        output_tokens:
          type: integer
          title: Output Tokens
        cache_read_tokens:
          type: integer
          title: Cache Read Tokens
        cache_creation_tokens:
          type: integer
          title: Cache Creation Tokens
        cost_cents:
          type: number
          title: Cost Cents
      type: object
      required:
        - attribution
        - model
        - flow
        - provider
        - day
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - cost_cents
      title: SystemUsageRecord
    SystemUsageAttribution:
      type: string
      enum:
        - ATTRIBUTED
        - UNATTRIBUTED
      title: SystemUsageAttribution
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Authorization header with Bearer token

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.