How you add credit to the account, see what is left, get unspent credit back, and what happens when it runs out. What credit pays for is on Pricing.
Only the owner or an admin adds credit, and the account needs its plan. An agent cannot top up.
Top up my STACK credit with 50 dollars.The client calls stack_start_wallet_top_up and returns a link to Stripe's checkout page. You pay there. The credit is added when Stripe confirms the payment. You can also top up in the Console, or over the API:
curl -X POST https://api.getstack.run/v1/billing/topup \
-H "Authorization: Bearer <access token>" \
-H "Content-Type: application/json" \
-d '{ "amount_cents": 5000 }'
# { "checkout_url": "...", "session_id": "..." }stack_usage returns the balance with the month's use. From the terminal, usage prints it. Over the API: GET /v1/billing/balance and GET /v1/billing/transactions.
curl -X POST https://api.getstack.run/v1/billing/refund/<transaction-id> \
-H "Authorization: Bearer <access token>"If a top-up is disputed with the card issuer, paid actions are refused with 402 SPEND_FROZEN until the dispute is settled. Work inside what the plan includes still runs.
Credit is shared by all of your agents. With controls on, you can give one agent a monthly budget, when its account is opened (monthly_budget_cents) or later. Past it, that agent is refused with 402 AGENT_BUDGET_EXCEEDED until the next month.
await stack.accounts.setBudget('acct_123', { monthly_budget_cents: 5000 }); // 50.00 USD a month
await stack.accounts.setBudget('acct_123', { monthly_budget_cents: null }); // no budgetEvery billing route is on Billing. To pay suppliers with your card, see Your own card.