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

# Usage per key

> Labels and requests per API key in a month, most labels first. Keys without usage that month are left out.



## OpenAPI

````yaml /console-openapi.json get /api/v1/usage/keys
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/keys:
    get:
      tags:
        - Console API
      summary: Usage per key
      description: >-
        Labels and requests per API key in a month, most labels first. Keys
        without usage that month are left out.
      operationId: getUsageKeys
      parameters:
        - name: month
          in: query
          required: false
          description: >-
            The calendar month in UTC, as `YYYY-MM`. Defaults to the current
            month.
          schema:
            type: string
            pattern: ^[0-9]{4}-[0-9]{2}$
            example: 2026-10
      responses:
        '200':
          description: One entry per key used that month.
          headers:
            Cache-Control:
              $ref: '#/components/headers/CacheControl'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KeyUsageList'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  headers:
    CacheControl:
      description: Always `no-store`.
      schema:
        type: string
        example: no-store
  schemas:
    KeyUsageList:
      type: object
      required:
        - month
        - keys
      properties:
        month:
          type: string
          example: 2026-10
        keys:
          type: array
          items:
            type: object
            required:
              - key_id
              - name
              - type
              - labels
              - requests
              - last_used
            properties:
              key_id:
                type: string
                format: uuid
              name:
                type:
                  - string
                  - 'null'
                description: '`null` when the key no longer exists.'
              type:
                type: string
                enum:
                  - live
                  - test
                description: '`live` keys are billed; `test` keys are free and watermarked.'
              labels:
                type: integer
              requests:
                type: integer
              last_used:
                type: string
                format: date-time
                description: The latest request with this key in the month.
    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.