> ## 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.

# Export Usage

> Company-wide daily usage export by email.

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


## OpenAPI

````yaml GET /admin/usage/export
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/export:
    get:
      tags:
        - public
      summary: Export Usage
      description: Company-wide daily usage export by email.
      operationId: export_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/UsageExportResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    UsageExportResponse:
      properties:
        start:
          type: string
          title: Start
        end:
          type: string
          title: End
        users:
          items:
            $ref: '#/components/schemas/UsageExportUser'
          type: array
          title: Users
      type: object
      required:
        - start
        - end
        - users
      title: UsageExportResponse
      description: Nested per-user daily usage export.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UsageExportUser:
      properties:
        email:
          type: string
          title: Email
        totals:
          $ref: '#/components/schemas/UsageExportTotals'
        records:
          items:
            $ref: '#/components/schemas/UsageExportRecord'
          type: array
          title: Records
      type: object
      required:
        - email
        - totals
        - records
      title: UsageExportUser
    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
    UsageExportRecord:
      properties:
        model:
          type: string
          title: Model
        flow:
          type: string
          title: Flow
        provider:
          type: string
          title: Provider
        incognito:
          type: boolean
          title: Incognito
        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:
        - model
        - flow
        - provider
        - incognito
        - day
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - cost_cents
      title: UsageExportRecord
  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.