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

# Get AI Usage

> Get AI usage history broken down by day and workspace.



## OpenAPI

````yaml GET /api/v1/users/me/ai-usage
openapi: 3.1.0
info:
  title: Rigbox Public API
  description: >-
    Gateway-owned public API for Rigbox. The gateway composes its local
    lifecycle API with service-owned exported specs.
  contact:
    name: Rigbox
    url: https://rigbox.dev
  license:
    name: ''
  version: 1.0.0
servers:
  - url: https://api.rigbox.dev
    description: Production gateway
security: []
tags:
  - name: Workspaces
  - name: CLI
  - name: Observability
  - name: Auth
  - name: API Keys
  - name: Access Control
  - name: Apps
  - name: App Catalog
  - name: Logs
  - name: AI
  - name: Tools
  - name: Snapshots
  - name: SSH Keys
  - name: Templates
  - name: Setup Scripts
  - name: Service Specs
  - name: Deploy
  - name: Community
  - name: User Settings
  - name: Roadmap
  - name: System
paths:
  /api/v1/users/me/ai-usage:
    get:
      tags:
        - AI
      summary: Get AI usage history and workspace breakdown.
      description: Get AI usage history and per-workspace breakdown for the account.
      operationId: get_ai_usage
      responses:
        '200':
          description: AI usage history
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAiUsageResponse'
      security:
        - bearer: []
components:
  schemas:
    GetAiUsageResponse:
      type: object
      required:
        - window_days
        - daily
        - by_workspace
      properties:
        by_workspace:
          type: array
          items:
            $ref: '#/components/schemas/AiUsageWorkspaceTotal'
        daily:
          type: array
          items:
            $ref: '#/components/schemas/AiUsageDaily'
        window_days:
          type: integer
          format: int32
    AiUsageWorkspaceTotal:
      type: object
      required:
        - workspace_id
        - workspace_name
        - input_tokens
        - output_tokens
        - credits
        - credits_micro
        - requests
      properties:
        credits:
          type: number
          format: double
        credits_micro:
          type: integer
          format: int64
        input_tokens:
          type: integer
          format: int64
        output_tokens:
          type: integer
          format: int64
        requests:
          type: integer
          format: int64
        workspace_id:
          type: string
        workspace_name:
          type: string
    AiUsageDaily:
      type: object
      required:
        - day
        - input_tokens
        - output_tokens
        - credits
        - credits_micro
        - requests
      properties:
        credits:
          type: number
          format: double
        credits_micro:
          type: integer
          format: int64
        day:
          type: string
        input_tokens:
          type: integer
          format: int64
        output_tokens:
          type: integer
          format: int64
        requests:
          type: integer
          format: int64
  securitySchemes:
    bearer:
      type: http
      scheme: bearer

````