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

# Report pre-aggregated usage

> Reports pre-aggregated feature usage from your application to kelviq.

<Info>Click the base URL in the API playground and select the **Sandbox** host for test data or the **Production** host for live data. Use credentials from the same environment.</Info>


## OpenAPI

````yaml /api-reference/openapi.json post /report/usage/
openapi: 3.0.0
info:
  title: kelviq API
  version: 1.0.0
  description: >-
    API for interacting with kelviq services, derived from Python SDK
    documentation.
servers:
  - url: https://sandboxapi.kelviq.com/api/v1
    description: Sandbox — Test payments
  - url: https://api.kelviq.com/api/v1
    description: Production — Live payments
security:
  - bearerAuth: []
tags:
  - name: Products
    description: Catalog products.
  - name: Product Settings
    description: Per-product settings (currency, VPN/Tor/proxy, product URL).
  - name: Product Files
    description: Product images and downloadable assets.
  - name: Features
    description: Catalog features that can be granted as plan entitlements.
  - name: Plans
    description: Catalog plans (CRUD, publish, versions, prices).
  - name: Plan Entitlements
    description: Feature entitlements attached to a plan.
  - name: Plan Files
    description: Files attached to plans, and signed download links.
  - name: Media
    description: Generate presigned S3 upload URLs for product/plan images and files.
  - name: Partner
    description: Partner integration APIs (organization provisioning, lookup).
  - name: Charges
    description: >-
      One-time payments charged immediately against a customer's default payment
      method.
  - name: Refunds
    description: Full and partial refunds for paid orders.
  - name: Transactions
    description: >-
      Charges, refunds, disputes, and other financial movements for the
      authenticated organization.
  - name: Payment Methods
    description: Saved customer payment methods (cards, etc.).
  - name: Orders
    description: Completed and resolved orders for the authenticated organization.
  - name: Order Events
    description: Timeline events for a specific order.
  - name: Webhooks
    description: Delivery logs for webhook events sent to your configured endpoints.
  - name: Checkout Sessions
    description: Merchant-side view of checkout sessions created by customers.
  - name: Checkout Session Events
    description: Timeline events for a specific checkout session.
paths:
  /report/usage/:
    post:
      tags:
        - Reporting
      summary: Report pre-aggregated usage
      description: Reports pre-aggregated feature usage from your application to kelviq.
      operationId: reportUsage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ReportUsageRequest'
      responses:
        '200':
          description: Usage reported successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportUsageResponse'
              example:
                value: 150
                customerId: customer_001
                featureId: seats
                behaviour: SET
                orgId: '1'
                eventName: aggregated.usage
                idempotencyKey: 597ee95063c744ed9bcc9b1cf5676a8a
                timestamp: '2025-05-22 08:27:45.430732'
components:
  schemas:
    ReportUsageRequest:
      type: object
      required:
        - value
        - customerId
        - featureId
        - behaviour
      properties:
        value:
          type: integer
          description: The usage value being reported.
          example: 150
        customerId:
          type: string
          description: Unique identifier for the customer associated with this usage.
          example: customer_001
        featureId:
          type: string
          description: Unique identifier for the feature for which usage is being reported.
          example: seats
        behaviour:
          type: string
          enum:
            - SET
            - DELTA
          description: Dictates how the usage is updated. SET replaces, DELTA increments.
          example: SET
    ReportUsageResponse:
      type: object
      properties:
        value:
          type: integer
          example: 150
        customerId:
          type: string
          example: customer_001
        featureId:
          type: string
          example: seats
        behaviour:
          type: string
          enum:
            - SET
            - DELTA
          example: SET
        orgId:
          type: string
          example: '1'
        eventName:
          type: string
          description: Internal event name (e.g., "aggregated.usage").
          example: aggregated.usage
        idempotencyKey:
          type: string
          description: >-
            Server-generated unique idempotency key for this usage report
            instance.
          example: 597ee95063c744ed9bcc9b1cf5676a8a
        timestamp:
          type: string
          description: >-
            Server-generated UTC timestamp (e.g., yyyy-MM-dd HH:mm:ss.ffffff)
            when the report was processed.
          example: '2025-05-22 08:27:45.430732'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        The Server API Key obtained from the kelviq application. Pass as a
        Bearer token in the Authorization header. Example: 'Authorization:
        Bearer __YOUR_API_KEY__'

````