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

# Credit consumption

> Get your current credit balance and the credits consumed between two dates



## OpenAPI

````yaml GET /credits_consumption
openapi: 3.0.1
info:
  title: Pipecorn Miscellaneous API
  description: Pipecorn Miscellaneous API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.pipecorn.com/api/v2/
security:
  - defaultApiKey: []
paths:
  /credits_consumption:
    get:
      summary: Retrieve credit consumption for a date range
      description: >-
        Returns your current credit balance and the total enrichment credits
        consumed between a start and end date (inclusive). Dates are provided as
        `YYYY-MM-DD` query parameters and are interpreted in UTC, from the start
        of `start_date` to the end of `end_date`.
      parameters:
        - name: start_date
          in: query
          required: true
          description: Start of the range (inclusive), formatted as YYYY-MM-DD.
          schema:
            type: string
            format: date
            example: '2026-01-01'
        - name: end_date
          in: query
          required: true
          description: >-
            End of the range (inclusive), formatted as YYYY-MM-DD. Must be on or
            after start_date.
          schema:
            type: string
            format: date
            example: '2026-01-31'
      responses:
        '200':
          description: Current balance and credits consumed over the requested range
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditConsumption'
        '422':
          description: >-
            Missing or invalid date parameters (missing date, malformed date, or
            start_date after end_date)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    CreditConsumption:
      type: object
      properties:
        current_credit_balance:
          type: integer
          description: Your current enrichment credit balance.
          example: 3000
        consumption:
          type: object
          properties:
            start_date:
              type: string
              format: date
              description: Start of the range (inclusive), echoed back.
              example: '2026-01-01'
            end_date:
              type: string
              format: date
              description: End of the range (inclusive), echoed back.
              example: '2026-01-31'
            credits_consumed:
              type: integer
              description: Total enrichment credits consumed within the range.
              example: 1250
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: integer
          description: The error code
          format: int32
        message:
          type: string
  securitySchemes:
    defaultApiKey:
      type: apiKey
      in: header
      description: Your API key
      name: X-API-KEY

````