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

# List AI Usage

> AI spend broken down by project, flow, agent, user, key or model.



## OpenAPI

````yaml GET /v1/ai-usage/items
openapi: 3.1.0
info:
  title: Activepieces Documentation
  version: 0.0.0
servers:
  - url: https://cloud.activepieces.com/api
    description: Production Server
security: []
externalDocs:
  url: https://www.activepieces.com/docs
  description: Find more info here
paths:
  /v1/ai-usage/items:
    get:
      tags:
        - ai-usage
      description: AI spend broken down by project, flow, agent, user, key or model.
      parameters:
        - schema:
            type: string
            enum:
              - 1h
              - 6h
              - 12h
              - 24h
              - 7d
              - 30d
              - 90d
              - this-month
              - last-month
          in: query
          name: period
          required: true
        - schema:
            type: string
            enum:
              - all
              - production
              - testing
          in: query
          name: scope
          required: true
        - schema:
            type: string
            enum:
              - project
              - flow
              - agent
              - user
              - key
              - model
          in: query
          name: dimension
          required: true
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  history:
                    type: object
                    properties:
                      trackingSince:
                        anyOf:
                          - type: string
                          - type: 'null'
                      hasAnyUsage:
                        type: boolean
                      coveredDays:
                        type: number
                      periodDays:
                        type: number
                      currentCoverage:
                        type: number
                      comparable:
                        type: boolean
                    required:
                      - trackingSince
                      - hasAnyUsage
                      - coveredDays
                      - periodDays
                      - currentCoverage
                      - comparable
                    additionalProperties: false
                  ranges:
                    type: object
                    properties:
                      current:
                        type: object
                        properties:
                          start:
                            type: string
                          end:
                            type: string
                        required:
                          - start
                          - end
                        additionalProperties: false
                      previous:
                        type: object
                        properties:
                          start:
                            type: string
                          end:
                            type: string
                        required:
                          - start
                          - end
                        additionalProperties: false
                    required:
                      - current
                      - previous
                    additionalProperties: false
                  items:
                    type: array
                    items:
                      type: object
                      properties:
                        dimension:
                          type: string
                          enum:
                            - project
                            - flow
                            - agent
                            - user
                            - key
                            - model
                        id:
                          type: string
                        name:
                          anyOf:
                            - type: string
                            - type: 'null'
                        parent:
                          type: string
                        provider:
                          type: string
                          enum:
                            - openai
                            - openrouter
                            - anthropic
                            - azure
                            - google
                            - activepieces
                            - cloudflare-gateway
                            - custom
                            - bedrock
                            - vertex
                            - mistral
                            - xai
                            - deepseek
                            - zai
                            - qwen
                            - minimax
                            - moonshot
                            - meta
                            - nvidia
                        flowCount:
                          type: number
                        agentCount:
                          type: number
                        spendUsd:
                          type: number
                        previousSpendUsd:
                          type: number
                        calls:
                          type: number
                        tokens:
                          type: number
                        comparable:
                          type: boolean
                        sharedUsd:
                          type: number
                        inputPrice:
                          type: number
                        outputPrice:
                          type: number
                      required:
                        - dimension
                        - id
                        - name
                        - spendUsd
                        - previousSpendUsd
                        - calls
                        - tokens
                        - comparable
                      additionalProperties: false
                  count:
                    type: number
                  itemsSpendUsd:
                    type: number
                  totalSpendUsd:
                    type: number
                  truncated:
                    type: boolean
                required:
                  - history
                  - ranges
                  - items
                  - count
                  - itemsSpendUsd
                  - totalSpendUsd
                  - truncated
                additionalProperties: false
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: http
      description: Use your api key generated from the admin console
      scheme: bearer

````

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