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

# Report usage

> Records an idempotent usage report for an access grant.



## OpenAPI

````yaml https://api.zeroclick.io/openapi.json post /v1/usage/
openapi: 3.0.0
info:
  title: ZeroClick API
  description: >-
    REST API for managing ZeroClick sellers, services, pricing, usage, and
    analytics. Authenticate with an API key from the ZeroClick dashboard.
  version: 1.0.0
servers:
  - url: https://api.zeroclick.io
security:
  - bearerAuth: []
tags:
  - name: API keys
  - name: Sellers
  - name: Services
  - name: Meters
  - name: Plans
  - name: Plan meter prices
  - name: Usage
  - name: Analytics
  - name: Stripe Connect
  - name: Sandbox
  - name: Organizations
  - name: Users
paths:
  /v1/usage/:
    post:
      tags:
        - Usage
      summary: Report usage
      description: Records an idempotent usage report for an access grant.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                zcAgentId:
                  type: string
                  minLength: 1
                  maxLength: 200
                idempotencyKey:
                  type: string
                  minLength: 1
                  maxLength: 200
                serviceSlug:
                  type: string
                  minLength: 1
                  maxLength: 80
                  pattern: ^[a-z0-9]+(?:-[a-z0-9]+)*$
                meterSlug:
                  type: string
                  minLength: 1
                  maxLength: 80
                  pattern: ^[a-z][a-z0-9_]*$
                quantity:
                  type: integer
                  minimum: 1
                  maximum: 2147483647
                occurredAt:
                  type: string
                  format: date-time
                  pattern: >-
                    ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
              required:
                - zcAgentId
                - idempotencyKey
                - serviceSlug
                - meterSlug
                - quantity
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  recorded:
                    type: boolean
                    enum:
                      - true
                  duplicate:
                    type: boolean
                  usageEvent:
                    type: object
                    properties:
                      id:
                        type: string
                      zcAgentId:
                        type: string
                      zcRequestId:
                        nullable: true
                        type: string
                      idempotencyKey:
                        nullable: true
                        type: string
                      meterSlug:
                        type: string
                      quantity:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      totalCostUsd:
                        type: string
                      source:
                        type: string
                        enum:
                          - async
                          - sync
                      occurredAt:
                        type: string
                    required:
                      - id
                      - zcAgentId
                      - zcRequestId
                      - idempotencyKey
                      - meterSlug
                      - quantity
                      - totalCostUsd
                      - source
                      - occurredAt
                    additionalProperties: false
                required:
                  - recorded
                  - duplicate
                  - usageEvent
                additionalProperties: false
        '402':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - service_not_found
                      - access_not_found
                      - access_inactive
                      - plan_expired
                      - meter_not_found
                      - meter_not_priced
                      - usage_exhausted
                      - insufficient_scope
                      - auth_type_not_allowed
                required:
                  - error
                additionalProperties: false
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - service_not_found
                      - access_not_found
                      - access_inactive
                      - plan_expired
                      - meter_not_found
                      - meter_not_priced
                      - usage_exhausted
                      - insufficient_scope
                      - auth_type_not_allowed
                required:
                  - error
                additionalProperties: false
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - service_not_found
                      - access_not_found
                      - access_inactive
                      - plan_expired
                      - meter_not_found
                      - meter_not_priced
                      - usage_exhausted
                      - insufficient_scope
                      - auth_type_not_allowed
                required:
                  - error
                additionalProperties: false
        '409':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    enum:
                      - service_not_found
                      - access_not_found
                      - access_inactive
                      - plan_expired
                      - meter_not_found
                      - meter_not_priced
                      - usage_exhausted
                      - insufficient_scope
                      - auth_type_not_allowed
                required:
                  - error
                additionalProperties: false
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key created in the ZeroClick dashboard under Settings → API keys.
        Keys start with `zc_`. Send them as `Authorization: Bearer zc_...`.

````