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

# Get credit balance (API key)

> Returns the workspace credit balance and the current credit cost per invoice upload.



## OpenAPI

````yaml /openapi/programmatic.json get /api/v1/credits/balance
openapi: 3.0.0
info:
  title: SnapIt Programmatic API
  description: >-
    Public API-key endpoints for invoice upload, extracted JSON, credit balance,
    and top-up. Authenticate with `Authorization: Bearer sk_live_…`. Full
    operator Swagger (including admin/JWT routes) remains at `/api/docs` on the
    API host.
  version: '1.0'
  contact: {}
servers:
  - url: https://api.trysnapit.com
    description: Production
  - url: http://localhost:3000
    description: Local development
security:
  - api-key: []
tags:
  - name: programmatic
    description: API-key authenticated upload, invoice JSON, balance, and credit top-up
paths:
  /api/v1/credits/balance:
    get:
      tags:
        - programmatic
      summary: Get credit balance (API key)
      description: >-
        Returns the workspace credit balance and the current credit cost per
        invoice upload.
      operationId: getBalance
      parameters: []
      responses:
        '200':
          description: Current balance and per-invoice cost
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditBalanceResponseDto'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorResponseDto'
      security:
        - api-key: []
components:
  schemas:
    CreditBalanceResponseDto:
      type: object
      properties:
        balance:
          type: number
          example: 42
          description: Remaining credits for the tenant
        creditCostPerInvoice:
          type: number
          example: 1
          description: >-
            Credits deducted when an invoice upload is accepted (before OCR
            completes)
      required:
        - balance
        - creditCostPerInvoice
    ApiErrorResponseDto:
      type: object
      properties:
        statusCode:
          type: number
          example: 401
        message:
          oneOf:
            - type: string
            - type: array
              items:
                type: string
          example: Invalid or missing API key
        error:
          type: string
          example: Unauthorized
      required:
        - statusCode
        - message
  securitySchemes:
    api-key:
      type: apiKey
      in: header
      name: Authorization
      description: Bearer sk_live_… (include the Bearer prefix)
      x-default: Bearer sk_live_…

````

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