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

# Get Billing Usage



## OpenAPI

````yaml https://api.galileo.ai/public/v2/openapi.json get /v2/billing/usage/{metric}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://api.galileo.ai
    description: Galileo Public APIs - galileo-v2
security: []
paths:
  /v2/billing/usage/{metric}:
    get:
      tags:
        - integrations
      summary: Get Billing Usage
      operationId: get_billing_usage_v2_billing_usage__metric__get
      parameters:
        - name: metric
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/BillingUsageMetric'
        - name: start_time
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: Start of time range (UTC)
            title: Start Time
          description: Start of time range (UTC)
        - name: end_time
          in: query
          required: true
          schema:
            type: string
            format: date-time
            description: End of time range (UTC)
            title: End Time
          description: End of time range (UTC)
        - name: interval
          in: query
          required: true
          schema:
            $ref: '#/components/schemas/CostInterval'
            description: Aggregation interval
          description: Aggregation interval
        - name: project_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            description: Optional project filter
            title: Project Id
          description: Optional project filter
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUsageResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
        - ClassicAPIKeyHeader: []
        - OAuth2PasswordBearer: []
        - HTTPBasic: []
components:
  schemas:
    BillingUsageMetric:
      type: string
      enum:
        - traces
        - spans
        - luna_tokens
        - luna_fine_tuning_runs
        - total_users
        - monthly_active_users
      title: BillingUsageMetric
    CostInterval:
      type: string
      enum:
        - hourly
        - daily
        - weekly
        - monthly
      title: CostInterval
    BillingUsageResponse:
      properties:
        metric:
          $ref: '#/components/schemas/BillingUsageMetric'
        total:
          type: integer
          title: Total
          default: 0
        projects:
          items:
            $ref: '#/components/schemas/ProjectBillingUsage'
          type: array
          title: Projects
        available:
          type: boolean
          title: Available
          default: true
        unavailable_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Unavailable Reason
      type: object
      required:
        - metric
      title: BillingUsageResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ProjectBillingUsage:
      properties:
        project_id:
          type: string
          format: uuid4
          title: Project Id
        project_name:
          type: string
          title: Project Name
        total:
          type: integer
          title: Total
          default: 0
        data_points:
          items:
            $ref: '#/components/schemas/BillingUsageDataPoint'
          type: array
          title: Data Points
      type: object
      required:
        - project_id
        - project_name
      title: ProjectBillingUsage
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    BillingUsageDataPoint:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
        value:
          type: integer
          title: Value
      type: object
      required:
        - timestamp
        - value
      title: BillingUsageDataPoint
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: Splunk-AO-API-Key
    ClassicAPIKeyHeader:
      type: apiKey
      in: header
      name: Galileo-API-Key
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: https://api.galileo.ai/login
    HTTPBasic:
      type: http
      scheme: basic

````