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

# Get the current consumption

> Returns the credit balance for the current billing period of the company owning the API key: included, consumed and remaining credits, usage percentage, the period boundaries (the end date being when credits recharge) and the subscription status. Figures are reported as-is, including a negative remaining balance or a usage above 100%.



## OpenAPI

````yaml GET /Consumption
openapi: 3.0.1
info:
  title: Starleads public API documentation
  description: >
    Welcome to the Starleads Public API documentation. This API provides public
    access to Starleads services, allowing developers and growth-hackers to
    interact with campaign-related data.

    ***

    ### Base endpoint

    ```https://api.starleads.co```

    ***

    ### Errors

    The API uses standard HTTP status codes to indicate the success or failure
    of the API call. In case of failure, the body of the response will be JSON
    in the following format:

    ```

    {
      "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1",
      "title": "Bad Request",
      "status": 400,
      "detail": "No campaign exists with campaignId : 11111111"
    }

    ```

    The ```type``` property is a link to a general description of the error
    type.

    ***

    ### Authentification

    Authentication for the API is handled with an API key that must be provided
    as a ```X-Api-Key``` header for every request.<br>

    **API keys are supposed to be a secret that only the client and server know.
    Please remember to not share them with anyone.**<br>

    You can find your API keys when authenticated in your Starleads profile
    :<br> ![Api key menu option](../images/api-menu-option-screenshot.png)
  version: v1
  x-logo:
    url: https://api.starleads.co/images/starleads-logo.png
servers: []
security: []
tags:
  - name: Agent
    description: >-
      Manage your AI agent's prompt. These endpoints allow you to read and
      update the prompt that drives your agent's behavior during calls.
  - name: CampaignField
    description: >-
      CampaignFields enables users to specify customizable fields within their
      campaigns. These fields serve as placeholders (e.g., ```{lastname}```)
      that can be dynamically filled with corresponding data when creating
      prompts, providing flexibility in tailoring campaign content based on
      specific variables.<br>**Those are the keys of the ```databag``` field of
      the request payload to add a new ```CampaignItem``` to a campaign.**
  - name: CampaignItem
    description: Represents prospects entries related to a campaign
  - name: Consumption
    description: >-
      Track your company's credit consumption. These endpoints expose your
      current balance, usage and billing period so you can build budget
      monitoring on top of the API.
  - name: Subscription
    description: >-
      Inspect your subscription contract: the plan you are on, your subscription
      status, the features currently active and your effective limits. No
      pricing information is exposed.
paths:
  /Consumption:
    get:
      tags:
        - Consumption
      summary: Get the current consumption balance
      description: >-
        Returns the credit balance for the current billing period of the company
        owning the API key: included, consumed and remaining credits, usage
        percentage, the period boundaries (the end date being when credits
        recharge) and the subscription status. Figures are reported as-is,
        including a negative remaining balance or a usage above 100%.
      operationId: GetCurrentConsumption
      parameters:
        - name: X-Api-Key
          in: header
          description: API key for authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumptionBalance'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '502':
          description: Server Error
        '504':
          description: Server Error
components:
  schemas:
    ConsumptionBalance:
      type: object
      properties:
        includedCredits:
          type: number
          description: Credits included in the current billing period
          format: double
        consumedCredits:
          type: number
          description: Credits consumed so far in the current billing period
          format: double
        remainingCredits:
          type: number
          description: >-
            Credits remaining in the current billing period. Published as-is,
            including negative values when consumption exceeds the included
            credits.
          format: double
        usagePercent:
          type: number
          description: >-
            Usage as a percentage of the included credits. Published as-is,
            including values above 100.
          format: double
        periodStart:
          type: string
          description: Start of the current billing period (UTC)
          format: date-time
        periodEnd:
          type: string
          description: >-
            End of the current billing period, i.e. the date the credits
            recharge (UTC)
          format: date-time
        status:
          type: string
          description: >-
            Subscription status for the current period (e.g. Active, PastDue,
            Paused, Cancelled)
          nullable: true
      additionalProperties: false
      description: Current billing period balance for the company
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
      additionalProperties: {}

````