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

# Get usage report



## OpenAPI

````yaml /openapi.json get /api/v1/usage
openapi: 3.1.0
info:
  title: Capy API
  version: 1.0.0
  description: Programmatic access to Capy's agent platform.
servers:
  - url: https://api.capy.ai
security:
  - bearerAuth: []
tags:
  - name: threads
  - name: tasks
  - name: messages
  - name: reviews
  - name: usage
paths:
  /api/v1/usage:
    get:
      tags:
        - usage
      summary: Get usage report
      operationId: usage.get
      parameters:
        - name: from
          in: query
          schema:
            type: string
          required: false
        - name: to
          in: query
          schema:
            type: string
          required: false
      responses:
        '200':
          description: UsageReport
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageReport'
        '400':
          description: capy/InvalidRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_InvalidRequest'
        '401':
          description: capy/Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_Unauthorized'
      security:
        - bearerAuth: []
components:
  schemas:
    UsageReport:
      type: object
      properties:
        from:
          type: string
        to:
          type: string
        totals:
          $ref: '#/components/schemas/UsageDollars'
        tokens:
          $ref: '#/components/schemas/UsageTokenTotals'
        members:
          type: array
          items:
            $ref: '#/components/schemas/UsageMemberDollars'
        models:
          type: array
          items:
            $ref: '#/components/schemas/UsageModelDollars'
      required:
        - from
        - to
        - totals
        - tokens
        - members
        - models
      additionalProperties: false
    capy_InvalidRequest:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/InvalidRequest
        message:
          type: string
      required:
        - _tag
        - message
      additionalProperties: false
    capy_Unauthorized:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Unauthorized
      required:
        - _tag
      additionalProperties: false
    UsageDollars:
      type: object
      properties:
        llmDollars:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        vmDollars:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        totalDollars:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
      required:
        - llmDollars
        - vmDollars
        - totalDollars
      additionalProperties: false
    UsageTokenTotals:
      type: object
      properties:
        inputTokens:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        outputTokens:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        cacheReadTokens:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        cacheWriteTokens:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
      required:
        - inputTokens
        - outputTokens
        - cacheReadTokens
        - cacheWriteTokens
      additionalProperties: false
    UsageMemberDollars:
      type: object
      properties:
        principalUserId:
          anyOf:
            - type: string
            - type: 'null'
        llmDollars:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        vmDollars:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        totalDollars:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
      required:
        - principalUserId
        - llmDollars
        - vmDollars
        - totalDollars
      additionalProperties: false
    UsageModelDollars:
      type: object
      properties:
        model:
          type: string
        label:
          type: string
        dollars:
          anyOf:
            - anyOf:
                - type: number
                - type: string
                  enum:
                    - NaN
                - type: string
                  enum:
                    - Infinity
                - type: string
                  enum:
                    - '-Infinity'
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        unbilled:
          type: boolean
        tokens:
          $ref: '#/components/schemas/UsageTokenTotals'
      required:
        - model
        - label
        - dollars
        - unbilled
        - tokens
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Capy API key
      description: An API key created in Capy under Settings → API.

````