Top up the balance
top_upAdd credit to the workspace balance by charging its saved default card (the only card it can use; cards are added in the dashboard, never here). This spends real money. It needs the billing permission on this sign-in, which a workspace owner or manager turns on in the dashboard's API keys page; without it the answer is BILLING_PERMISSION_REQUIRED. Each sign-in has daily and monthly top-up caps (UTC); past one the answer is TOPUP_CAP_REACHED with what is left. Answers status: succeeded (balance_usd is the new balance), processing (top_up with the same idempotency_key again reads its status), requires_action (nothing is charged yet: give your user confirm_url, which a workspace owner or manager opens signed in to confirm the payment before expires_at; the same idempotency_key then reads the result) or declined (reason and message say why; tell your user).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"amount_usd": "<amount_usd>"
},
"name": "top_up"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workspace | No | Workspace ID (optional: defaults to the authenticated workspace) | |
| amount_usd | Yes | Amount to add, in USD: 20 to 10000, in cents at most | |
| environment | No | Environment name (optional: defaults to the environment this session acts in) | |
| idempotency_key | No | Optional: the same key answers the same top-up with its current status instead of charging again. Derived from this call when left out, so a retried call never charges twice. Pass the idempotency_key of an earlier answer to read that top-up's status. |