> ## 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.

# Create customer billing



## OpenAPI

````yaml post /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:
    post:
      summary: Create customer billing
      operationId: createCustomerBilling
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerBillingMeterRequest'
      responses:
        '200':
          description: The created billing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomerBillingMeterResponse'
        '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:
    CreateCustomerBillingMeterRequest:
      type: object
      properties:
        totalCredits:
          type: string
          pattern: ^\d+$
          default: '0'
        allowOverages:
          type: boolean
          default: false
        spendCap:
          type: string
          pattern: ^\d+$
        externalMeterId:
          type: string
        workspaceId:
          type: string
      required:
        - externalMeterId
        - workspaceId
    CreateCustomerBillingMeterResponse:
      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

````