Spending Controls
Manage your AI agent spending with API key limits and balance monitoring.
API Key Limits
Each API key can have optional spending limits:
| Limit | Description |
|---|---|
| Per-call | Maximum cost for a single tool call |
| Daily | Maximum total spend in a 24-hour period |
| Monthly | Maximum total spend in a calendar month |
When a limit is hit, the tool call is rejected with a SPENDING_LIMIT_EXCEEDED error. No charges are incurred.
Setting Limits
- Go to xpay.tools → Account → API Keys
- Click on a key to edit its limits
- Set per-call, daily, and/or monthly limits
- Save changes — limits take effect immediately
Tip: Create separate API keys for different agents or projects, each with its own spending limit.
Balance Management
Checking Your Balance
- In the dashboard: Account → Billing shows your current balance
- Programmatically: Use the
xpay_balancemeta-tool through the master server - In tool responses: Every billing receipt shows your remaining balance
Topping Up
Add credits at xpay.tools → Account → Billing:
- Credit card — Instant top-up via Stripe
- Crypto — Send USDC on Base to your account wallet
Best Practices
- Create per-project keys — Separate keys for each project or agent makes spending easy to track
- Set conservative limits — Start with low limits and increase as you understand your usage patterns
- Monitor the billing receipts — The
Balancein each receipt helps you track spend in real-time - Use provider endpoints for predictable costs — When you connect directly to a provider, you know exactly which tools (and prices) are available
Last updated on: