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

# Retrieve Monitor Credit Usage

> See credits charged per monitor over a time window so you always know what your monitors cost.

<Badge color="green">0 Credits</Badge>


## OpenAPI

````yaml GET /monitors/credit-usage
openapi: 3.0.0
info:
  title: Context API
  description: API for retrieving context data from any website
  version: 1.0.0
servers:
  - url: https://api.context.dev/v1
security: []
tags:
  - name: Monitors
    description: >-
      Monitor pages, sitemaps, and extracted website data for exact or semantic
      changes. The change.detected webhook payload is documented by the
      MonitorsChangeDetectedWebhookPayload schema.
paths:
  /monitors/credit-usage:
    get:
      tags:
        - Monitors
      summary: Monitor credit usage
      description: >-
        Returns credits charged per monitor over an optional [since, until]
        window, newest spenders first.
      operationId: listMonitorCreditUsage
      parameters:
        - name: since
          in: query
          required: false
          schema:
            type: string
            format: date-time
        - name: until
          in: query
          required: false
          schema:
            type: string
            format: date-time
      responses:
        '200':
          description: Per-monitor credit usage
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MonitorsCreditUsageResponse'
        '401':
          $ref: '#/components/responses/MonitorsUnauthorized'
      security:
        - bearerAuth: []
components:
  schemas:
    MonitorsCreditUsageResponse:
      type: object
      title: Monitor credit usage response
      required:
        - data
        - total_credits
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/MonitorsCreditUsage'
        total_credits:
          type: integer
          description: Sum of credits across all monitors in the window.
      additionalProperties: false
    MonitorsCreditUsage:
      type: object
      title: Monitor credit usage
      required:
        - monitor_id
        - name
        - credits
        - runs
      properties:
        monitor_id:
          type: string
          example: mon_123
        name:
          type: string
          description: Monitor name (falls back to the id when the monitor was deleted).
        credits:
          type: integer
          description: Credits charged to this monitor over the window.
        runs:
          type: integer
          description: Number of billed runs over the window.
      additionalProperties: false
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
          description: Error message
        error_code:
          type: string
          enum:
            - INTERNAL_ERROR
            - VALID
            - NOT_FOUND
            - FORBIDDEN
            - USAGE_EXCEEDED
            - RATE_LIMITED
            - UNAUTHORIZED
            - DISABLED
            - INSUFFICIENT_PERMISSIONS
            - TIMEOUT_EXCEEDS_MAXIMUM
            - WEBSITE_ACCESS_ERROR
            - EXTERNAL_PROVIDER_ERROR
            - INPUT_VALIDATION_ERROR
            - REQUEST_TIMEOUT
          description: Error code indicating the type of error
        key_metadata:
          $ref: '#/components/schemas/KeyMetadata'
    KeyMetadata:
      type: object
      description: >-
        Metadata about the API key used for the request. Included in every
        response whenever a valid API key is provided, even when the response
        status is not 200.
      properties:
        credits_consumed:
          type: integer
          description: The number of credits consumed by this request.
        credits_remaining:
          type: integer
          description: >-
            The number of credits remaining for your organization after this
            request.
      required:
        - credits_consumed
        - credits_remaining
  responses:
    MonitorsUnauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````