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

# GET /api/usage



## OpenAPI

````yaml /api/worksong.openapi.json get /api/usage
openapi: 3.1.0
info:
  title: Worksong API
  version: 042e65d5f227
  description: >-
    The HTTP API behind the Worksong apps, generated from the code at the commit
    below. Request and response shapes come from the shared zod contract; an
    operation marked `x-gaps` has a part the generator could not resolve.
  x-source: worksong-ai/worksong@042e65d5f2275493f60f879c7970dcfdeceb7e0e
servers:
  - url: https://app.worksong.ai
security:
  - bearerAuth: []
tags:
  - name: Approvals
  - name: Audit
  - name: Avatar generator
  - name: Bootstrap
  - name: Bot compute limit
  - name: Bot mcp servers
  - name: Bots
  - name: Calls
  - name: Connections
  - name: Contacts
  - name: Conversations
  - name: Coupons
  - name: Day grants
  - name: Desktop
  - name: Entity files
  - name: Files
  - name: Github
  - name: Insights
  - name: Login
  - name: Mcp servers
  - name: Me
  - name: Me bot messaging
  - name: Me chat header
  - name: Me daily limit
  - name: Me time zone
  - name: Memory
  - name: Message delete
  - name: Messages
  - name: Notifications
  - name: Optimize prompt
  - name: Phone
  - name: Places
  - name: Projects
  - name: Public file links
  - name: Push
  - name: Queue
  - name: Reactions
  - name: Register
  - name: Rooms
  - name: Routes
  - name: Routines
  - name: Runs
  - name: Skills
  - name: Tasks
  - name: Transcribe
  - name: Tts
  - name: Webhooks
  - name: Whats new
  - name: Whatsapp
  - name: Workspace files
paths:
  /api/usage:
    get:
      tags:
        - Runs
      summary: GET /api/usage
      operationId: get_api_usage
      parameters:
        - name: botId
          in: query
          required: false
          schema:
            type: string
            format: uuid
        - name: from
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: to
          in: query
          required: false
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  total:
                    type: object
                    properties:
                      botId:
                        anyOf:
                          - type: string
                            format: uuid
                          - type: 'null'
                      from:
                        type: string
                        format: date-time
                      to:
                        type: string
                        format: date-time
                      runCount:
                        type: integer
                        minimum: 0
                        maximum: 9007199254740991
                      usage:
                        type: object
                        properties:
                          inputTokens:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          outputTokens:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          cacheReadInputTokens:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                          cacheCreationInputTokens:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                        required:
                          - inputTokens
                          - outputTokens
                          - cacheReadInputTokens
                          - cacheCreationInputTokens
                        additionalProperties: false
                      costUsd:
                        type: number
                        minimum: 0
                        maximum: 1000000
                      monthlyBudgetUsd:
                        anyOf:
                          - type: number
                            minimum: 0
                            maximum: 1000000
                          - type: 'null'
                      budgetRemainingUsd:
                        type:
                          - number
                          - 'null'
                      aiCostUsd:
                        type: number
                        minimum: 0
                        maximum: 1000000
                      compute:
                        type: object
                        properties:
                          chargeUsd:
                            type: number
                            minimum: 0
                            maximum: 1000000
                          hours:
                            type: number
                            minimum: 0
                          computerHours:
                            type: number
                            minimum: 0
                          sessions:
                            type: integer
                            minimum: 0
                            maximum: 9007199254740991
                        required:
                          - chargeUsd
                          - hours
                          - computerHours
                          - sessions
                        additionalProperties: false
                    required:
                      - botId
                      - from
                      - to
                      - runCount
                      - usage
                      - costUsd
                      - monthlyBudgetUsd
                      - budgetRemainingUsd
                    additionalProperties: false
                  perBot:
                    type: array
                    items:
                      type: object
                      properties:
                        botId:
                          anyOf:
                            - type: string
                              format: uuid
                            - type: 'null'
                        from:
                          type: string
                          format: date-time
                        to:
                          type: string
                          format: date-time
                        runCount:
                          type: integer
                          minimum: 0
                          maximum: 9007199254740991
                        usage:
                          type: object
                          properties:
                            inputTokens:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            outputTokens:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            cacheReadInputTokens:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                            cacheCreationInputTokens:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                          required:
                            - inputTokens
                            - outputTokens
                            - cacheReadInputTokens
                            - cacheCreationInputTokens
                          additionalProperties: false
                        costUsd:
                          type: number
                          minimum: 0
                          maximum: 1000000
                        monthlyBudgetUsd:
                          anyOf:
                            - type: number
                              minimum: 0
                              maximum: 1000000
                            - type: 'null'
                        budgetRemainingUsd:
                          type:
                            - number
                            - 'null'
                        aiCostUsd:
                          type: number
                          minimum: 0
                          maximum: 1000000
                        compute:
                          type: object
                          properties:
                            chargeUsd:
                              type: number
                              minimum: 0
                              maximum: 1000000
                            hours:
                              type: number
                              minimum: 0
                            computerHours:
                              type: number
                              minimum: 0
                            sessions:
                              type: integer
                              minimum: 0
                              maximum: 9007199254740991
                          required:
                            - chargeUsd
                            - hours
                            - computerHours
                            - sessions
                          additionalProperties: false
                      required:
                        - botId
                        - from
                        - to
                        - runCount
                        - usage
                        - costUsd
                        - monthlyBudgetUsd
                        - budgetRemainingUsd
                      additionalProperties: false
                  account:
                    type: object
                    properties:
                      monthlyBudgetUsd:
                        type: number
                        minimum: 0
                        maximum: 1000000
                      monthSpendUsd:
                        type: number
                        minimum: 0
                        maximum: 1000000
                      budgetRemainingUsd:
                        type: number
                    required:
                      - monthlyBudgetUsd
                      - monthSpendUsd
                      - budgetRemainingUsd
                    additionalProperties: false
                required:
                  - total
                  - perBot
                  - account
                additionalProperties: false
        4XX:
          description: Error. A problem object with a status and a message.
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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