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

# Get usage metrics

> Get usage metrics for the workspace



## OpenAPI

````yaml https://api.getcargo.io/openapi.json get /billing/usage/metrics
openapi: 3.1.0
info:
  title: Cargo API
  version: 1.0.0
  description: Cargo Platform API v1
servers:
  - url: https://api.getcargo.io/v1
    description: Cargo API
security:
  - bearerAuth: []
paths:
  /billing/usage/metrics:
    get:
      tags:
        - Billing - Usage
      summary: Get usage metrics
      description: Get usage metrics for the workspace
      parameters:
        - in: query
          name: workflowUuid
          schema:
            title: Workflow UUID
            description: Filter metrics by workflow identifier.
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: Filter metrics by workflow identifier.
        - in: query
          name: modelUuid
          schema:
            title: Model UUID
            description: Filter metrics by model identifier.
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: Filter metrics by model identifier.
        - in: query
          name: connectorUuid
          schema:
            title: Connector UUID
            description: Filter metrics by connector identifier.
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: Filter metrics by connector identifier.
        - in: query
          name: integrationSlug
          schema:
            title: Integration slug
            description: Filter metrics by integration slug.
            type: string
          description: Filter metrics by integration slug.
        - in: query
          name: slug
          schema:
            title: Slug
            description: Filter metrics by slug.
            type: string
          description: Filter metrics by slug.
        - in: query
          name: agentUuid
          schema:
            title: Agent UUID
            description: Filter metrics by agent identifier.
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$
          description: Filter metrics by agent identifier.
        - in: query
          name: from
          schema:
            type: string
            title: From
            description: Start of the time range.
          required: true
          description: Start of the time range.
        - in: query
          name: to
          schema:
            type: string
            title: To
            description: End of the time range.
          required: true
          description: End of the time range.
        - in: query
          name: groupBy
          schema:
            title: Group by
            description: Group metrics by this dimension.
            type: string
            enum:
              - integration_slug
              - connector_uuid
              - model_uuid
              - workflow_uuid
              - agent_uuid
          description: Group metrics by this dimension.
        - in: query
          name: unit
          schema:
            title: Unit
            description: Usage unit to report.
            type: string
            enum:
              - billing.credits
              - storage.records
              - orchestration.executions
          description: Usage unit to report.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  metrics:
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                        items:
                          type: array
                          items:
                            type: object
                            properties:
                              slug:
                                type: string
                              count:
                                type: number
                              groupBy:
                                anyOf:
                                  - type: string
                                  - type: 'null'
                            required:
                              - slug
                              - count
                              - groupBy
                            additionalProperties: false
                      required:
                        - date
                        - items
                      additionalProperties: false
                    title: Metrics
                    description: Usage metrics for the selected range.
                required:
                  - metrics
                additionalProperties: false
        '400':
          description: Bad request
        '401':
          description: Unauthorized
        '404':
          description: Not found
        '500':
          description: Internal server error
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````