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

# Credit usage ledger (API key)

> Paginated credit usage for the authenticated project. Filter by workflow, execution, thread, or external user.



## OpenAPI

````yaml /api-reference/openapi.json get /api/v1/usage
openapi: 3.0.0
info:
  title: Flowra API (API Key Endpoints)
  description: >-
    **Flowra** is an AI-powered platform for building agents, workflows, and
    integrations.


    ### Capabilities

    - **Tools & Toolkits** – Define and group tools for agents and workflows.

    - **Workflows** – Orchestrate steps and automate processes.

    - **Triggers** – Schedule or event-based execution.

    - **Auth & Connections** – OAuth, API keys, and connected accounts.

    - **MCP** – Model Context Protocol server integration.

    - **Knowledge / RAG** – Add files and URLs for retrieval-augmented
    generation.


    ### Authentication

    Use the **x-api-key** header with a project API key to access endpoints that
    support API Key auth. Create and manage API keys in the dashboard under your
    project settings.


    Only endpoints that support API Key authentication via the @ApiKeyEnabled()
    decorator.


    Send x-api-key (required). On multi-tenant endpoints, optionally send
    x-username to act as an external user.
  version: '1.0'
  contact:
    name: Flowra
    url: https://flowra.dev
servers:
  - url: https://flowra.dev
    description: Flowra API
security: []
tags:
  - name: Users
    description: User profile
  - name: External Users
    description: End-user identities inside a project (x-username)
  - name: Auth Configs
    description: OAuth and API key configs for toolkits
  - name: Connected Accounts
    description: OAuth connected accounts and link creation
  - name: Toolkits
    description: List and search toolkits
  - name: Tools
    description: List, execute, and manage tools
  - name: Skills
    description: Browse, create, import, and install skills
  - name: Workflow & Agent
    description: Create, run, and inspect workflows and agents
  - name: Triggers
    description: Schedule and event-based trigger instances
  - name: Chat
    description: Threads and streaming agent runs
  - name: File
    description: Upload, list, and download files
  - name: Knowledge
    description: RAG knowledge collections
  - name: Table
    description: Collections and documents
  - name: Sandbox
    description: Ephemeral and durable code sandboxes
  - name: Browser
    description: Live browser sessions and view
  - name: LLM
    description: List AI models and generate completions
  - name: MCP
    description: MCP server management
  - name: usage
    description: Credit balance and usage ledger for the project API key
paths:
  /api/v1/usage:
    get:
      tags:
        - usage
      summary: Credit usage ledger (API key)
      description: >-
        Paginated credit usage for the authenticated project. Filter by
        workflow, execution, thread, or external user.
      operationId: UsageController_list
      parameters:
        - name: projectId
          required: false
          in: query
          description: 'Project filter (user: own projects only; admin: any project)'
          schema:
            type: string
        - name: page
          required: false
          in: query
          description: Page number
          schema:
            minimum: 1
            default: 1
            example: 1
            type: number
        - name: limit
          required: false
          in: query
          description: Items per page
          schema:
            minimum: 1
            maximum: 100
            default: 20
            example: 20
            type: number
        - name: from
          required: false
          in: query
          description: Start date (ISO 8601)
          schema:
            example: '2026-08-01T00:00:00.000Z'
            type: string
        - name: to
          required: false
          in: query
          description: End date (ISO 8601)
          schema:
            example: '2026-09-01T00:00:00.000Z'
            type: string
        - name: workflowId
          required: false
          in: query
          description: Filter by workflow (agent) ID
          schema:
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            type: string
        - name: executionId
          required: false
          in: query
          description: Filter by workflow execution log ID
          schema:
            format: uuid
            example: 7c9e6679-7425-40de-944b-e07fc1f90ae7
            type: string
        - name: eUID
          required: false
          in: query
          description: External user id
          schema:
            format: uuid
            example: 3fa85f64-5717-4562-b3fc-2c963f66afa6
            type: string
        - name: threadId
          required: false
          in: query
          description: LangGraph thread id (via execution logs)
          schema:
            example: b737d8af-a9e0-4251-9714-3fdc1126e5fb
            type: string
        - name: type
          required: false
          in: query
          description: Usage type (ai_model, tool, sandbox, …)
          schema:
            example: tool
            enum:
              - ai_model
              - tool
              - sandbox
              - browser
              - workflow
              - media
              - connected_account
            type: string
      responses:
        '200':
          description: Credit usage retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditUsageResponseDtoSuccessResponse'
              example:
                success: true
                message: Operation completed successfully
                data:
                  items:
                    - id: ''
                      userId: ''
                      projectId: ''
                      workflowId: ''
                      executionId: ''
                      eUID: ''
                      externalUserName: ''
                      type: ai_model
                      creditAmount: 0
                      delta: 0
                      entryType: debit
                      usdCost: 0
                      platformCostUsd: 0
                      metadata: {}
                      createdAt: ''
                  total: 0
                  summary:
                    byType:
                      ai_model: 0
                      tool: 0
                      sandbox: 0
                      browser: 0
                      workflow: 0
                      media: 0
                      connected_account: 0
                    total: 0
                    count: 0
      security:
        - x-api-key: []
components:
  schemas:
    CreditUsageResponseDtoSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
          description: Success status
          example: true
        message:
          type: string
          description: Success message
          example: Operation completed successfully
        data:
          type: object
          properties:
            items:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                  userId:
                    type: string
                  projectId:
                    type: string
                    nullable: true
                  workflowId:
                    type: string
                    nullable: true
                  executionId:
                    type: string
                    nullable: true
                    description: Workflow execution log id when attributed
                  eUID:
                    type: string
                    nullable: true
                    description: External user id when attributed
                  externalUserName:
                    type: string
                    nullable: true
                    description: External user name (usage/me only)
                  type:
                    type: string
                    enum:
                      - ai_model
                      - tool
                      - sandbox
                      - browser
                      - workflow
                      - media
                      - connected_account
                  creditAmount:
                    type: number
                  delta:
                    type: number
                    description: >-
                      Signed wallet change: negative when taken, positive when
                      returned
                  entryType:
                    type: string
                    enum:
                      - debit
                      - credit
                  usdCost:
                    type: number
                    nullable: true
                    description: Amount charged to the user (USD)
                  platformCostUsd:
                    type: number
                    nullable: true
                    description: Actual platform cost (USD; AI usage only)
                  metadata:
                    type: object
                    nullable: true
                  createdAt:
                    type: string
                required:
                  - id
                  - userId
                  - projectId
                  - workflowId
                  - executionId
                  - eUID
                  - type
                  - creditAmount
                  - delta
                  - entryType
                  - usdCost
                  - platformCostUsd
                  - metadata
                  - createdAt
            total:
              type: number
            summary:
              type: object
              properties:
                byType:
                  type: object
                  properties:
                    ai_model:
                      type: number
                    tool:
                      type: number
                    sandbox:
                      type: number
                    browser:
                      type: number
                    workflow:
                      type: number
                    media:
                      type: number
                    connected_account:
                      type: number
                total:
                  type: number
                count:
                  type: number
              required:
                - byType
                - total
                - count
          required:
            - items
            - total
            - summary
          example:
            items:
              - id: ''
                userId: ''
                projectId: ''
                workflowId: ''
                executionId: ''
                eUID: ''
                externalUserName: ''
                type: ai_model
                creditAmount: 0
                delta: 0
                entryType: debit
                usdCost: 0
                platformCostUsd: 0
                metadata: {}
                createdAt: ''
            total: 0
            summary:
              byType:
                ai_model: 0
                tool: 0
                sandbox: 0
                browser: 0
                workflow: 0
                media: 0
                connected_account: 0
              total: 0
              count: 0
      required:
        - success
        - message
        - data
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Project API key. Create and manage keys in the dashboard under Project →
        API Keys. Send as header: x-api-key: <your-key>

````