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

# Get Credit Balance

> Read the unified available, subscription, purchased and used credits.

Requires `credits:read`. The response is a unified balance, not separate quotas per feature:

* `available`: subscription plus purchased credits remaining.
* `subscription`: remaining plan allocation for this cycle.
* `purchased`: purchased credits remaining; these carry over.
* `used`: credits consumed during the current cycle.
* `nextResetDate`: subscription allocation reset timestamp, or null when no active subscription/license applies.

Lead extraction costs **1 credit per lead**. Lead-database searches reserve **2 credits per requested lead** and return unused credits at completion. The balance is independent of sender quotas and API rate limits.


## OpenAPI

````yaml GET /v1/credits
openapi: 3.0.0
info:
  title: SendPilot External API
  description: >

    # SendPilot External API v1


    Public API for integrating with SendPilot programmatically.


    ## Authentication


    Requests authenticate with a workspace API key in the `X-API-Key` header:


    ```

    X-API-Key: sp_live_your_api_key_here

    ```


    `Authorization: Bearer sp_live_...` (or `sp_test_...`) is also accepted.
    Prefer one header; `X-API-Key` takes precedence. Clerk OAuth tokens for MCP
    connection URLs are not public REST API keys.


    A key only reaches what its scopes and creator's current workspace
    permissions allow. Each operation lists the scopes it needs in
    `x-sp-scopes`. Use `GET /v1/me` to inspect the effective permissions and
    subscription state.


    ## Rate Limits


    - **Per API Key**: 300 requests/minute

    - **Per Workspace**: 50,000 requests/day


    Responses that reach the rate limiter include these headers; early
    authentication failures may not:

    - `X-RateLimit-Limit`: Max requests per minute

    - `X-RateLimit-Remaining`: Remaining requests in current window

    - `X-RateLimit-Reset`: Epoch timestamp when limit resets


    ## LinkedIn Sender Limits


    When using messaging endpoints, these headers show account limits:

    - `X-LinkedIn-Messages-Remaining`: Messages left today

    - `X-LinkedIn-Connections-Remaining`: Connection requests left today

    - `X-LinkedIn-Quota-Reset-At`: When daily limits reset


    ## Retries


    Send an `Idempotency-Key` header on POST and PATCH requests. A retry with
    the same key within 24 hours returns the first result (with
    `Idempotent-Replayed: true`) instead of acting twice. The same key with a
    different request answers 422 `IDEMPOTENCY_KEY_REUSED`; a retry while the
    first request still runs answers 409 `IDEMPOTENCY_IN_PROGRESS`.


    Once execution is attempted, its response (including errors) is retained. If
    a process stops or result storage fails after the attempt, the durable
    record blocks another execution for the replay window and returns 409
    `IDEMPOTENCY_IN_PROGRESS` or `IDEMPOTENCY_REPLAY_UNAVAILABLE`. Check the
    operation's status before using a new key: an uncertain outcome may already
    have acted. Requests refused before execution is claimed, such as
    authentication or rate-limit refusals, can be retried with the same key.


    ## Webhooks


    Configure webhooks in the SendPilot app to receive real-time events:

    - `lead.tag.updated`

    - `lead.updated`

    - `message.sent`

    - `reply.received`

    - `connection_request.sent`

    - `connection_request.accepted`

    - `campaign.started`

    - `campaign.paused`

    - `campaign.resumed`

    - `campaign.finished`


    ## Error Codes


    Errors return a JSON body. Use the machine-readable `code` when supplied;
    validation messages can be arrays, and some legacy errors omit `code`. A
    typical error is:

    ```json

    {
      "statusCode": 400,
      "error": "Bad Request",
      "code": "SPECIFIC_ERROR_CODE",
      "message": "Human-readable description"
    }

    ```
  version: '1.0'
  contact:
    name: SendPilot Support
    url: https://sendpilot.ai
    email: support@sendpilot.ai
servers:
  - url: https://api.sendpilot.ai
security: []
tags: []
paths:
  /v1/credits:
    get:
      tags:
        - External API - Credits
      summary: Get unified credit balance
      description: >-
        Returns the workspace credit balance. All operations (lead extraction,
        enrichment, lead database) draw from this single pool.
      operationId: credits.get
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditsResponseDto'
        '401':
          description: Invalid or missing API key
        '404':
          description: Workspace not found
        '429':
          description: Rate limit exceeded
        '500':
          description: Internal server error
      security:
        - api-key: []
components:
  schemas:
    CreditsResponseDto:
      type: object
      properties:
        available:
          type: number
          example: 12500
          description: >-
            Total credits available now (sum of subscription + purchased
            buckets).
        subscription:
          type: number
          example: 7500
          description: >-
            Plan allocation remaining. Reset to the plan total at the start of
            each billing cycle.
        purchased:
          type: number
          example: 5000
          description: >-
            Purchased credits remaining. These never expire and roll over across
            billing cycles.
        used:
          type: number
          example: 2500
          description: Credits consumed in the current billing cycle.
        nextResetDate:
          type: string
          example: '2026-06-01T00:00:00.000Z'
          description: >-
            ISO 8601 timestamp at which the subscription bucket will next reset
            to the plan total. `null` for workspaces with no active
            subscription/license.
          nullable: true
      required:
        - available
        - subscription
        - purchased
        - used
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'API key for authentication (prefix: sp_live_ or sp_test_)'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.