> ## 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 My Usage

> Caller's token/cost usage for the Usage tab.

> [!NOTE]
>
> **Required permission:** none beyond a valid session or token. Returns the caller's own usage.


## OpenAPI

````yaml GET /user/usage
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:
  /user/usage:
    get:
      tags:
        - public
      summary: Get My Usage
      description: Caller's token/cost usage for the Usage tab.
      operationId: get_my_usage
      parameters:
        - name: days
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
                maximum: 3650
                minimum: 1
              - type: 'null'
            title: Days
        - 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
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserUsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    UserUsageResponse:
      properties:
        per_day_by_model:
          items:
            $ref: '#/components/schemas/UserUsageByDay'
          type: array
          title: Per Day By Model
        window_cost_cents:
          type: number
          title: Window Cost Cents
        budget_cents:
          anyOf:
            - type: number
            - type: 'null'
          title: Budget Cents
        budget_remaining_cents:
          anyOf:
            - type: number
            - type: 'null'
          title: Budget Remaining Cents
        budget_period_hours:
          anyOf:
            - type: integer
            - type: 'null'
          title: Budget Period Hours
        budget_reset_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Budget Reset At
        selected_model_price:
          anyOf:
            - $ref: '#/components/schemas/ModelPrice'
            - type: 'null'
        available_model_prices:
          items:
            $ref: '#/components/schemas/ModelPrice'
          type: array
          title: Available Model Prices
      type: object
      required:
        - per_day_by_model
        - window_cost_cents
        - budget_cents
        - budget_remaining_cents
        - selected_model_price
      title: UserUsageResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    UserUsageByDay:
      properties:
        day:
          type: string
          title: Day
        model:
          type: string
          title: Model
        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:
        - day
        - model
        - input_tokens
        - output_tokens
        - cache_read_tokens
        - cache_creation_tokens
        - cost_cents
      title: UserUsageByDay
      description: Per-user usage aggregated by UTC calendar day and model.
    ModelPrice:
      properties:
        model:
          type: string
          title: Model
        provider:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider
        input_per_mtok:
          anyOf:
            - type: number
            - type: 'null'
          title: Input Per Mtok
        output_per_mtok:
          anyOf:
            - type: number
            - type: 'null'
          title: Output Per Mtok
        cache_per_mtok:
          anyOf:
            - type: number
            - type: 'null'
          title: Cache Per Mtok
        cache_write_per_mtok:
          anyOf:
            - type: number
            - type: 'null'
          title: Cache Write Per Mtok
      type: object
      required:
        - model
        - provider
        - input_per_mtok
        - output_per_mtok
        - cache_per_mtok
      title: ModelPrice
    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:
    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.