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

# Wallet balance + most recent billing rows

> Return the wallet's current balance and most recent billing rows.

All resource types are included (compute, training, inference, disks,
sandboxes, images) — same source-of-truth `Billing` table the
dashboard's Billing History tab reads. Sorted by `lastBilledAt` desc.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json get /api/v1/billing/wallet
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/v1/billing/wallet:
    get:
      tags:
        - Billing
      summary: Wallet balance + most recent billing rows
      description: |-
        Return the wallet's current balance and most recent billing rows.

        All resource types are included (compute, training, inference, disks,
        sandboxes, images) — same source-of-truth `Billing` table the
        dashboard's Billing History tab reads. Sorted by `lastBilledAt` desc.
      operationId: get_wallet_api_v1_billing_wallet_get
      parameters:
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 100
            minimum: 1
            description: Number of recent billing rows to include (max 100).
            default: 20
            title: Limit
          description: Number of recent billing rows to include (max 100).
        - name: offset
          in: query
          required: false
          schema:
            type: integer
            minimum: 0
            description: Skip this many rows before returning. Lets callers page.
            default: 0
            title: Offset
          description: Skip this many rows before returning. Lets callers page.
        - name: teamId
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: If provided, return the team's wallet (requires membership).
            title: Teamid
          description: If provided, return the team's wallet (requires membership).
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WalletResponse'
        '401':
          description: Authorization failed
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    WalletResponse:
      properties:
        wallet_id:
          type: string
          title: Wallet Id
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
        balance_usd:
          type: number
          title: Balance Usd
          description: Current balance in USD
        currency:
          type: string
          title: Currency
        total_billings:
          type: integer
          title: Total Billings
          description: Total billing rows on the wallet (across all pages)
        recent_billings:
          items:
            $ref: '#/components/schemas/BillingEntry'
          type: array
          title: Recent Billings
      type: object
      required:
        - wallet_id
        - balance_usd
        - currency
        - total_billings
        - recent_billings
      title: WalletResponse
      description: |-
        Snapshot of a wallet's balance + most recent billing rows.

        Drives `prime wallet`. One call returns everything an agent needs to
        audit the billing flow against a known training run.
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    BillingEntry:
      properties:
        id:
          type: string
          title: Id
        created_at:
          type: string
          format: date-time
          title: Created At
        updated_at:
          type: string
          format: date-time
          title: Updated At
        last_billed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Billed At
        amount_usd:
          type: number
          title: Amount Usd
        currency:
          type: string
          title: Currency
        resource_type:
          type: string
          title: Resource Type
        resource_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Resource Id
      type: object
      required:
        - id
        - created_at
        - updated_at
        - amount_usd
        - currency
        - resource_type
      title: BillingEntry
      description: |-
        A single row from the Billing table, with the resource derived from
        whichever foreign-key column is non-null.

        `resource_type` mirrors the strings the dashboard's billing page filters
        by (`compute`, `training`, `inference`, `disks`, `sandboxes`, `images`).
        `resource_id` is the matching FK value, so callers can drill back into
        the run / pod / disk / etc. that produced the charge.
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````