User and Billing Management

All user and billing methods are called directly on the BroClient instance.

client.get_user()

Retrieve basic user details including pricing tier, maximum allowed sessions, active sessions and available balance.

Returns (Dictionary):

python
{ "success": True, "user_name": "happy-panda", "email": "[email protected]", "max_sessions": 2, "active_sessions": 0, "balance": 15.50, "pricing_tier": "basic", "total_billed": 12.00 }

client.get_transactions(limit=10, offset=0)

Retrieve a paginated list of transaction history (ordered by creation date, newest first). This includes deposits, refunds and promo codes applied to the account.

Returns (Dictionary):

python
{ "success": True, "transactions": [ { "transaction_id": "tx_123456789", "amount": 20.00, "currency": "USD", "payment_method": "stripe", "status": "succeeded", "type": "deposit", "created_at": "2026-12-01T10:00:00Z" } ] }

client.topup_billing(amount)

Generate a Stripe Checkout Session URL to top up the user's balance.

Returns (Dictionary):

python
{ "success": True, "checkout_url": "https://checkout.stripe.com/c/pay/cs_test_..." }

client.get_billing_history(limit=10, offset=0)

Retrieve a paginated history of session billing documents. This provides detailed breakdowns of how your balance was consumed by past and active sessions (ordered by creation date, newest first).

Returns (Dictionary):

python
{ "success": True, "history": [ { "session_id": "8a7b6c5d-4e3f-2g1h-9i8j-7k6l5m4n3o2p", "created_at": "2026-05-14T09:00:00Z", "last_synced_at": "2026-05-14T09:15:00Z", "total_cost": 0.04, "total_billed": 0.05, "breakdown": { "runner_billed": 0.01, "proxy_billed": 0.02, "grounding_billed": 0.01, "llm_billed": 0.01, "ocr_billed": 0.00 }, "proxy_usage": { "total_traffic_mb": 1.5 }, "tokens_usage": { "total": 1500, "prompt": 1000, "completion": 500 } } ] }