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

# Report several usage events in one call



## OpenAPI

````yaml /openapi.json post /v1/billing/usage/batch
openapi: 3.0.0
info:
  title: Kerne API
  description: >-
    Kerne SaaS Foundation as a Service - authentication, authorization, and
    billing management. Errors follow standardized error codes (K1xxx-K9xxx)
    documented at https://docs.kerne.io/errors
  version: 1.0.0
  contact:
    name: Kerne Team
    url: https://kerne.io
    email: support@kerne.io
  license:
    name: Proprietary
    url: https://kerne.io/license
servers:
  - url: https://api.kerne.io
    description: Production Server
security: []
tags:
  - name: Auth
    description: Authentication endpoints
  - name: Waitlist
    description: Waitlist management
  - name: Invitations
    description: Invitation system
  - name: Billing
    description: 'The tenant''s end users: subscription, entitlements, usage, checkout'
  - name: Pricing
    description: Public pricing page data
paths:
  /v1/billing/usage/batch:
    post:
      tags:
        - Billing
      summary: Report several usage events in one call
      operationId: BillingController_reportUsageBatch
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportUsageBatchDto'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportUsageBatchResponseDto'
      security:
        - AppIdentifier: []
        - JWT: []
components:
  schemas:
    ReportUsageBatchDto:
      type: object
      properties:
        events:
          type: array
          items:
            $ref: '#/components/schemas/ReportUsageDto'
      required:
        - events
    ReportUsageBatchResponseDto:
      type: object
      properties:
        results:
          type: array
          items:
            $ref: '#/components/schemas/BatchUsageResultDto'
      required:
        - results
    ReportUsageDto:
      type: object
      properties:
        customer:
          type: string
          description: External id of the customer this usage belongs to.
        feature_key:
          type: string
        operation:
          type: string
          enum:
            - INCREMENT
            - SET
        delta:
          type: number
        idempotency_key:
          type: string
        metadata:
          type: object
        dimension_id:
          type: string
      required:
        - customer
        - feature_key
    BatchUsageResultDto:
      type: object
      properties:
        index:
          type: number
        status:
          type: string
          enum:
            - ok
            - error
        usage:
          $ref: '#/components/schemas/UsageResponseDto'
        error:
          type: string
      required:
        - index
        - status
    UsageResponseDto:
      type: object
      properties:
        id:
          type: string
        tenant_id:
          type: string
        subscription_id:
          type: string
          nullable: true
        customer_id:
          type: string
        feature_id:
          type: string
        feature_key:
          type: string
        feature_name:
          type: string
        value:
          type: number
        period_start:
          format: date-time
          type: string
        period_end:
          format: date-time
          type: string
        status:
          type: string
        created_at:
          format: date-time
          type: string
        updated_at:
          format: date-time
          type: string
      required:
        - id
        - tenant_id
        - feature_id
        - feature_key
        - feature_name
        - value
        - period_start
        - period_end
        - status
        - created_at
        - updated_at
  securitySchemes:
    AppIdentifier:
      type: apiKey
      in: header
      name: x-app-id
      description: App identifier (App.id, sent as the x-app-id header)
    JWT:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: JWT token obtained from /v1/auth/token

````