> ## 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: automations
  - name: projects
  - name: threads
  - name: captains
  - name: folders
  - name: subagents
  - name: tasks
  - name: messages
  - name: streams
  - name: reviews
  - name: reviewRules
  - name: reviewFilters
  - name: usage
  - name: users
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/UsageReportEncoded'
        '400':
          description: capy/InvalidRequest
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_InvalidRequestEncoded'
        '401':
          description: capy/Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_UnauthorizedEncoded'
        '403':
          description: capy/Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_ForbiddenEncoded'
        '429':
          description: capy/RateLimited
          headers:
            retry-after:
              schema:
                type: integer
              required: true
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/capy_RateLimitedEncoded'
      security:
        - bearerAuth: []
components:
  schemas:
    UsageReportEncoded:
      type: object
      properties:
        from:
          type: string
        to:
          type: string
        totals:
          $ref: '#/components/schemas/UsageDollarsEncoded'
        tokens:
          $ref: '#/components/schemas/UsageTokenTotalsEncoded'
        members:
          type: array
          items:
            $ref: '#/components/schemas/UsageMemberDollarsEncoded'
        models:
          type: array
          items:
            $ref: '#/components/schemas/UsageModelDollarsEncoded'
        images:
          type: array
          items:
            $ref: '#/components/schemas/UsageImageDollarsEncoded'
      required:
        - from
        - to
        - totals
        - tokens
        - members
        - models
        - images
      additionalProperties: false
    capy_InvalidRequestEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/InvalidRequest
        message:
          type: string
      required:
        - _tag
        - message
      additionalProperties: false
    capy_UnauthorizedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Unauthorized
      required:
        - _tag
      additionalProperties: false
    capy_ForbiddenEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/Forbidden
      required:
        - _tag
      additionalProperties: false
    capy_RateLimitedEncoded:
      type: object
      properties:
        _tag:
          type: string
          enum:
            - capy/RateLimited
        retryAfterSeconds:
          type: integer
      required:
        - _tag
        - retryAfterSeconds
      additionalProperties: false
    UsageDollarsEncoded:
      type: object
      properties:
        llmDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        imageDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        vmDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        totalDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
      required:
        - llmDollars
        - imageDollars
        - vmDollars
        - totalDollars
      additionalProperties: false
    UsageTokenTotalsEncoded:
      type: object
      properties:
        inputTokens:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        outputTokens:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        cacheReadTokens:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        cacheWriteTokens:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
      required:
        - inputTokens
        - outputTokens
        - cacheReadTokens
        - cacheWriteTokens
      additionalProperties: false
    UsageMemberDollarsEncoded:
      type: object
      properties:
        principalUserId:
          anyOf:
            - type: string
            - type: 'null'
        llmDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        imageDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        vmDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        totalDollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
      required:
        - principalUserId
        - llmDollars
        - imageDollars
        - vmDollars
        - totalDollars
      additionalProperties: false
    UsageModelDollarsEncoded:
      type: object
      properties:
        model:
          type: string
        label:
          type: string
        dollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
        unbilled:
          type: boolean
        tokens:
          $ref: '#/components/schemas/UsageTokenTotalsEncoded'
      required:
        - model
        - label
        - dollars
        - unbilled
        - tokens
      additionalProperties: false
    UsageImageDollarsEncoded:
      type: object
      properties:
        endpoint:
          type: string
        label:
          type: string
        dollars:
          anyOf:
            - type: number
            - type: string
              enum:
                - Infinity
                - '-Infinity'
                - NaN
      required:
        - endpoint
        - label
        - dollars
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Capy API key
      description: An API key created in Capy under Settings → API.

````

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