Skip to main content
A Direct account spends from a wallet to run chat and voice. There are two balance planes:
  • Workspace wallet — what the spend gate reads. Fund this to let the account actually run AI.
  • Sub-account wallet — a per-sub balance you can track separately.
All amounts are integer cents. The wallet endpoints need the billing:read scope (balance) and billing:update scope (credit/debit) — a key with only subaccounts:* scopes cannot move funds.

Check balances

Credit a wallet

The response reports the resulting balance and whether it was an idempotent replay:

Debit a wallet

POST /v3/subaccounts/{id}/wallet/debit takes the same body and claws funds back. A debit can never drive a balance negative — if the target plane doesn’t have enough, it returns 409 insufficient_balance and no funds move.
The idempotency_key is required on every credit and debit. If a request times out and you retry with the same key, the wallet moves exactly once.