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

# Get workspace credit balance

> Reads the authenticated workspace’s balance without starting work or making a purchase. Responses are private and uncached. A null exposure or spendable amount means unavailable, not zero. Check spendable_balance_status before using spendable_balance_credits.

Authentication: workspace API key in `Authorization: Bearer <key>`.

## Errors

| Status | Meaning |
| - | - |
| 401 | Missing or invalid workspace authentication. |
| 500 | Server failure. Retry this read; it does not start new work. |


## OpenAPI

````yaml openapi.json GET /api/v2/billing/balance
openapi: 3.1.1
info:
  title: Deepline API
  version: v2
  description: >-
    Discover typed GTM tools and callable Plays, then execute a tool or start
    and inspect a durable Deepline Play run. Use the MCP endpoint when your
    client supports Model Context Protocol.
  contact:
    name: Deepline support
    email: team@deepline.com
    url: https://deepline.com/contact
servers:
  - url: https://code.deepline.com
    description: Deepline production runtime API
security: []
tags:
  - name: Health
    description: Availability checks.
  - name: Billing
    description: Safe recovery of existing purchase intent.
  - name: Tools
    description: Discover and execute typed provider tools.
  - name: Plays
    description: Discover, start, and inspect durable Play runs.
externalDocs:
  description: API reference
  url: https://deepline.com/docs/api-reference
paths:
  /api/v2/billing/balance:
    get:
      tags:
        - Billing
      summary: Get workspace credit balance
      description: >-
        Reads the authenticated workspace’s balance without starting work or
        making a purchase. Responses are private and uncached. A null exposure
        or spendable amount means unavailable, not zero. Check
        spendable_balance_status before using spendable_balance_credits.
      operationId: getBillingBalance
      parameters:
        - name: view
          in: query
          description: >-
            Set pill for the compact display response; omit for the full balance
            and exposure breakdown.
          schema:
            type: string
            enum:
              - pill
      responses:
        '200':
          description: Full balance, or a compact display response when view=pill.
          content:
            application/json:
              schema:
                oneOf:
                  - type: object
                    properties:
                      org_id:
                        type: string
                      balance:
                        type: number
                      balance_display:
                        type: string
                      rough_usd_balance:
                        type: number
                      posted_balance_credits:
                        type:
                          - number
                          - 'null'
                      pending_spend_credits:
                        type:
                          - number
                          - 'null'
                      spendable_balance_credits:
                        type:
                          - number
                          - 'null'
                      spendable_balance_status:
                        type: string
                        enum:
                          - complete
                          - unavailable
                      spendable_balance_checked_at:
                        type:
                          - string
                          - 'null'
                      spendable_balance_message:
                        type: string
                      temporary_hold_credits:
                        type:
                          - number
                          - 'null'
                      temporary_hold_credits_truncated:
                        type:
                          - boolean
                          - 'null'
                      rough_usd_temporary_holds:
                        type:
                          - number
                          - 'null'
                      estimated_hold_credits:
                        type:
                          - number
                          - 'null'
                      incurred_unsettled_credits:
                        type:
                          - number
                          - 'null'
                      pending_wallet_debit_credits:
                        type:
                          - number
                          - 'null'
                      pending_wallet_refund_credits:
                        type:
                          - number
                          - 'null'
                      unpriced_unsettled_reservation_count:
                        type:
                          - number
                          - 'null'
                      exposure_status:
                        type: string
                        enum:
                          - complete
                          - partial
                          - unavailable
                      exposure_message:
                        type: string
                      temporary_hold_message:
                        type: string
                      balance_status:
                        type: string
                      has_payment_method:
                        type: boolean
                      payment_method:
                        type:
                          - object
                          - 'null'
                        description: >-
                          Saved-card display metadata, or null. Never contains
                          card credentials.
                        additionalProperties: true
                      recovery:
                        type: object
                        description: >-
                          Present when funding needs attention. Recovery
                          recommendations require explicit purchase approval.
                        additionalProperties: true
                      updated_at:
                        type:
                          - string
                          - 'null'
                    required:
                      - org_id
                      - balance
                      - spendable_balance_credits
                      - spendable_balance_status
                      - exposure_status
                  - type: object
                    properties:
                      org_id:
                        type: string
                      view:
                        const: pill
                      balance:
                        type: number
                      balance_display:
                        type: string
                      rough_usd_balance:
                        type: number
                      balance_status:
                        type: string
                      updated_at:
                        type:
                          - string
                          - 'null'
                    required:
                      - org_id
                      - view
                      - balance
                      - balance_display
                      - rough_usd_balance
                      - balance_status
                      - updated_at
        '401':
          description: Missing or invalid workspace authentication.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: Unauthorized
        '500':
          description: Server failure. Retry this read; it does not start new work.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          oneOf:
            - type: string
              description: Route-specific error message.
            - type: object
              properties:
                code:
                  type: string
                message:
                  type: string
                resolution:
                  type: string
              additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Deepline workspace API key
      description: >-
        Create a workspace API key in the Deepline dashboard before calling
        authenticated endpoints.

````

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