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

# Get usage for the authenticated API key.

> Returns daily request counts for the authenticated API key and the shared quotas that can limit it. This visibility request is operationally rate-limited but does not consume monthly API quota.



## OpenAPI

````yaml https://api.infrawatch.com/openapi.json?contract=d15375c get /usage
openapi: 3.1.0
info:
  description: >-
    Customer-facing Infrawatch APIs. Authenticate with an API key unless an
    operation documents another supported credential.


    ### Infrawatch Public API


    Public API authenticated exclusively with Infrawatch API keys.


    ### Infrawatch Customer Alerting API


    Project alert rules, destinations, silences, inbox state, and delivery
    history.


    ### Infrawatch Remote Browser API


    Project-scoped interactive browser sessions owned by Platform Core.


    Session admission, lifecycle, RBAC, audit, usage, screenshot history, and

    stream tickets are Platform Core resources. The browser master is private

    infrastructure and its identifiers, proxy routes, process options, and

    credentials are never exposed by this API.


    A session and all of its evidence are private to the credential that created

    it. Project managers may list project session metadata, inspect one
    session's

    metadata, and terminate it, but cannot access its live stream, screenshots,

    or network events.


    Terminal session metadata and screenshots are retained indefinitely. A

    creator can replay a terminal session as a new queued resource while

    preserving a durable link to the source session.


    ### Infrawatch ESI API


    Customer-facing External Surface Intelligence API for project-scoped

    product data authenticated by an Infrawatch API key. API keys

    are constrained to their immutable owner's project ceiling and assigned

    ESI scopes; human project-manager fallback never expands an API key.

    Authorised API-key requests are rate-limited and consume monthly quota.


    ### Infrawatch Reports API


    Threat report discovery API authenticated by an Infrawatch API key.


    ### Infrawatch Public Rules API


    Account-aware rule authoring, taxonomy, catalogue, and runtime observations
    for API clients.


    ### Infrawatch Search API


    Search hosts, services, DNS records, and certificates. Complete
    percent-encoded query strings are limited to 65536 bytes.
  title: Infrawatch Customer API
  version: 1.0.0
servers:
  - description: Infrawatch customer API
    url: https://api.infrawatch.com/api/v1
security: []
tags:
  - name: API Usage
  - name: Projects
  - name: Alert destinations
  - name: Alert rules
  - name: Alert silences
  - name: Alerts
  - name: Browser sessions
  - name: Browser evidence
  - name: Browser streaming
  - name: Access
  - name: Inventory
  - name: Dangling DNS
  - name: Findings
  - name: Secrets
  - name: Typosquatting
  - name: Services
  - name: AI Surface
  - description: Search hosts, services, DNS records, certificates, and open directories.
    name: Search
  - name: Dashboard
  - name: Reports
  - name: Rules
  - name: Rule tags
  - name: Rule observations
paths:
  /usage:
    servers:
      - url: https://api.infrawatch.com/api/v1
    get:
      tags:
        - API Usage
      summary: Get usage for the authenticated API key.
      description: >-
        Returns daily request counts for the authenticated API key and the
        shared quotas that can limit it. This visibility request is
        operationally rate-limited but does not consume monthly API quota.
      operationId: getCurrentAPIKeyUsage
      parameters:
        - description: UTC daily usage window ending at the current time.
          in: query
          name: range
          schema:
            default: 30d
            enum:
              - 7d
              - 30d
              - 90d
              - 180d
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  api_usage:
                    $ref: '#/components/schemas/api_v1_APIKeyUsage'
                required:
                  - api_usage
                type: object
          description: Current API-key usage and applicable quota state.
        '400':
          $ref: '#/components/responses/api_v1_BadRequest'
        '401':
          $ref: '#/components/responses/api_v1_Unauthorized'
        '429':
          $ref: '#/components/responses/api_v1_TooManyRequests'
        '503':
          $ref: '#/components/responses/api_v1_ServiceUnavailable'
      security:
        - apiKeyAuth: []
components:
  schemas:
    api_v1_APIKeyUsage:
      properties:
        api_key:
          $ref: '#/components/schemas/api_v1_APIKeyUsageIdentity'
        daily:
          items:
            $ref: '#/components/schemas/api_v1_APIKeyUsageDailyBucket'
          type: array
        freshness:
          $ref: '#/components/schemas/api_v1_APIKeyUsageFreshness'
        from:
          description: Inclusive start of the selected UTC usage window.
          format: date-time
          type: string
        month_to_date:
          $ref: '#/components/schemas/api_v1_APIKeyUsageMonthToDate'
        quotas:
          items:
            $ref: '#/components/schemas/api_v1_APIKeyUsageQuota'
          minItems: 1
          type: array
        range:
          enum:
            - 7d
            - 30d
            - 90d
            - 180d
          type: string
        rate_limit:
          $ref: '#/components/schemas/api_v1_APIKeyRateLimitPolicy'
        timezone:
          const: UTC
          type: string
        to:
          description: Exclusive end of the selected UTC usage window.
          format: date-time
          type: string
        totals:
          $ref: '#/components/schemas/api_v1_APIKeyUsageTotals'
      required:
        - range
        - from
        - to
        - timezone
        - api_key
        - totals
        - month_to_date
        - rate_limit
        - quotas
        - daily
        - freshness
      type: object
    api_v1_APIKeyUsageIdentity:
      properties:
        key_prefix:
          description: Non-secret prefix used to identify the API key.
          type: string
        name:
          type: string
        owner_kind:
          enum:
            - organisation
            - group
            - user
            - individual
          type: string
        owner_name:
          type: string
        owner_uuid:
          description: >-
            Organisation, group, organisation-membership, or individual-account
            UUID according to owner_kind.
          format: uuid
          type: string
        scopes:
          description: >-
            Scopes this key holds, sorted. Use it to see what the key can reach
            before calling an endpoint that would refuse it.
          items:
            type: string
          type: array
        uuid:
          format: uuid
          type: string
      required:
        - uuid
        - name
        - key_prefix
        - owner_kind
        - owner_uuid
        - owner_name
        - scopes
      type: object
    api_v1_APIKeyUsageDailyBucket:
      properties:
        date:
          format: date
          type: string
        partial:
          description: >-
            True for the current, still-open UTC day or when a durable hourly
            outcome remains unfinished. Use freshness.persisted_through to
            assess persistence lag.
          type: boolean
        requests:
          format: int64
          minimum: 0
          type: integer
      required:
        - date
        - requests
        - partial
      type: object
    api_v1_APIKeyUsageFreshness:
      properties:
        current_through:
          description: >-
            Redis time for the live monthly quota counters. Per-key series are
            durable only through persisted_through.
          format: date-time
          type: string
        persisted_through:
          description: Latest usage known to be durably stored in PostgreSQL.
          format: date-time
          type:
            - string
            - 'null'
      required:
        - current_through
        - persisted_through
      type: object
    api_v1_APIKeyUsageMonthToDate:
      properties:
        from:
          description: Inclusive UTC start of the current calendar month.
          format: date-time
          type: string
        requests:
          description: >-
            Requests admitted for this API key during the current calendar
            month.
          format: int64
          minimum: 0
          type: integer
        to:
          description: Current usage watermark.
          format: date-time
          type: string
      required:
        - from
        - to
        - requests
      type: object
    api_v1_APIKeyUsageQuota:
      properties:
        exhausted:
          type: boolean
        kind:
          enum:
            - account
            - group
          type: string
        limit:
          description: Effective monthly request limit, or null when unlimited.
          format: int64
          maximum: 9007199254740991
          minimum: 0
          type:
            - integer
            - 'null'
        owner_kind:
          enum:
            - organisation
            - group
            - individual
          type: string
        owner_uuid:
          format: uuid
          type: string
        remaining:
          description: Requests remaining in the current month, or null when unlimited.
          format: int64
          minimum: 0
          type:
            - integer
            - 'null'
        reset_at:
          description: Start of the next UTC calendar month.
          format: date-time
          type: string
        used:
          format: int64
          minimum: 0
          type: integer
      required:
        - kind
        - owner_kind
        - owner_uuid
        - used
        - limit
        - remaining
        - reset_at
        - exhausted
      type: object
    api_v1_APIKeyRateLimitPolicy:
      properties:
        limit:
          format: int64
          minimum: 1
          type: integer
        window_seconds:
          format: int64
          minimum: 1
          type: integer
      required:
        - limit
        - window_seconds
      type: object
    api_v1_APIKeyUsageTotals:
      properties:
        requests:
          description: Requests admitted for this API key in the selected range.
          format: int64
          minimum: 0
          type: integer
      required:
        - requests
      type: object
    api_v1_APIError:
      properties:
        error:
          properties:
            code:
              type: string
            field_errors:
              items:
                properties:
                  code:
                    type: string
                  field:
                    type: string
                  message:
                    type: string
                required:
                  - field
                  - code
                  - message
                type: object
              type: array
            message:
              type: string
            request_id:
              type: string
          required:
            - code
            - message
          type: object
      required:
        - error
      type: object
  responses:
    api_v1_BadRequest:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/api_v1_APIError'
      description: Invalid request.
    api_v1_Unauthorized:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/api_v1_APIError'
      description: Authentication required.
    api_v1_TooManyRequests:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/api_v1_APIError'
      description: The authenticated API key exceeded its operational rate limit.
      headers:
        Retry-After:
          description: Seconds until the API key can retry.
          schema:
            minimum: 0
            type: integer
    api_v1_ServiceUnavailable:
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/api_v1_APIError'
      description: Current usage data is temporarily unavailable.
  securitySchemes:
    apiKeyAuth:
      description: >-
        Infrawatch API key. Supply the complete key directly as the header
        value.
      in: header
      name: X-API-Key
      type: apiKey

````