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

# Retrieve customer billing



## OpenAPI

````yaml get /api/v1/customer-billing
openapi: 3.0.0
info:
  title: Oneloop API
  version: 1.0.0
  description: API Key Management
servers:
  - url: https://prod.oneloop.ai
    description: Production server
security:
  - bearerAuth: []
paths:
  /api/v1/customer-billing:
    get:
      summary: Retrieve customer billing
      operationId: getCustomerBilling
      parameters:
        - schema:
            type: string
            description: The workspace id.
          required: true
          name: workspaceId
          in: query
        - schema:
            type: string
            description: The external meter id.
          required: true
          name: externalMeterId
          in: query
      responses:
        '200':
          description: Customer billing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetCustomerBillingMeterResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    GetCustomerBillingMeterResponse:
      type: object
      properties:
        billing:
          $ref: '#/components/schemas/CustomerBillingMeter'
      required:
        - billing
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: number
              minimum: 0
              exclusiveMinimum: true
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
    CustomerBillingMeter:
      type: object
      nullable: true
      properties:
        id:
          type: string
        totalCredits:
          type: string
          pattern: ^d+$
        usedCredits:
          type: string
          pattern: ^d+$
        allowOverages:
          type: boolean
        spendCap:
          type: string
          nullable: true
          pattern: ^d+$
        createdAt:
          type: string
        updatedAt:
          type: string
      required:
        - id
        - totalCredits
        - usedCredits
        - allowOverages
        - spendCap
        - createdAt
        - updatedAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````