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

# List usage events

> Usage events, newest first, a page at a time. Pass `next_cursor` as `cursor` to get the next page, with the same `from` and `to`; it is `null` on the last page. Pages stay stable while new usage arrives.

`from` and `to` may be at most 31 days apart. Leave both out for the last 31 days; give one and the window is 31 days from or up to it.

Usage is recorded about once a second: an event counts the requests one key made in one format in that window (`requests`, from `at` to `until`). Requests with an `Idempotency-Key` are events of their own, so a retry counts once. Older events, from before usage was added up per second, are one request each.



## OpenAPI

````yaml /console-openapi.json get /api/v1/usage/events
openapi: 3.1.0
info:
  title: Caretly Console API
  version: 1.0.0
  description: >-
    Read your organisation's usage, API keys and billing status as JSON.
    Authenticate with any of your API keys, live or test. All endpoints are
    read-only.
servers:
  - url: https://caretly.dev/console
security:
  - bearerAuth: []
paths:
  /api/v1/usage/events:
    get:
      tags:
        - Console API
      summary: List usage events
      description: >-
        Usage events, newest first, a page at a time. Pass `next_cursor` as
        `cursor` to get the next page, with the same `from` and `to`; it is
        `null` on the last page. Pages stay stable while new usage arrives.


        `from` and `to` may be at most 31 days apart. Leave both out for the
        last 31 days; give one and the window is 31 days from or up to it.


        Usage is recorded about once a second: an event counts the requests one
        key made in one format in that window (`requests`, from `at` to
        `until`). Requests with an `Idempotency-Key` are events of their own, so
        a retry counts once. Older events, from before usage was added up per
        second, are one request each.
      operationId: listUsageEvents
      parameters:
        - name: from
          in: query
          required: false
          description: >-
            Start of the window (inclusive), RFC 3339. URL-encode a `+` offset
            as `%2B`, or use `Z`.
          schema:
            type: string
            format: date-time
            example: '2026-10-01T00:00:00Z'
        - name: to
          in: query
          required: false
          description: End of the window (exclusive), RFC 3339.
          schema:
            type: string
            format: date-time
            example: '2026-10-15T00:00:00Z'
        - name: limit
          in: query
          required: false
          description: Events per page.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 100
        - name: cursor
          in: query
          required: false
          description: The `next_cursor` of the previous page, unchanged.
          schema:
            type: string
      responses:
        '200':
          description: A page of events.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EventPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  headers:
    CacheControl:
      description: Always `no-store`.
      schema:
        type: string
        example: no-store
  schemas:
    EventPage:
      type: object
      required:
        - from
        - to
        - events
        - next_cursor
      properties:
        from:
          type: string
          format: date-time
          description: Start of the window used (inclusive).
        to:
          type: string
          format: date-time
          description: End of the window used (exclusive).
        events:
          type: array
          items:
            $ref: '#/components/schemas/Event'
        next_cursor:
          type:
            - string
            - 'null'
          description: Pass as `cursor` for the next page; `null` on the last page.
    Event:
      type: object
      required:
        - request_id
        - key_id
        - type
        - labels
        - requests
        - format
        - at
        - until
      properties:
        request_id:
          type: string
          format: uuid
          description: 'Unique per event: the id of a single request, or of the window.'
        key_id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - live
            - test
          description: '`live` keys are billed; `test` keys are free and watermarked.'
        labels:
          type: integer
          description: Labels (pages) rendered by the requests of this event.
          example: 3
        requests:
          type: integer
          description: 'Requests this event counts: 1 for a single request.'
          example: 6
        format:
          type: string
          enum:
            - pdf
            - png
        at:
          type: string
          format: date-time
          description: When the (first) request was rendered.
        until:
          type: string
          format: date-time
          description: >-
            When the last request was rendered; equal to `at` for a single
            request.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: What went wrong.
  responses:
    BadRequest:
      description: A query parameter is not valid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: '`from` and `to` may be at most 31 days apart.'
    Unauthorized:
      description: The API key is missing, invalid, expired or revoked.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: >-
              This API key has been revoked. Send one of your API keys as
              `Authorization: Bearer <key>`; manage keys at
              https://caretly.dev/console/keys
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        One of your API keys (`zpl_live_…` or `zpl_test_…`), created at
        https://caretly.dev/console/keys. Revoked keys are refused immediately.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.