Skip to main content

Overview

Spending controls let you set guardrails on your ACN account. This is especially useful when running autonomous agents that make API calls without human supervision. You can configure:
  • Daily spend limit — block all calls once your daily budget is used up
  • Per-call limit — block calls that cost more than a set threshold
  • Low-balance alert — get an email before your credits run out
All limits are checked in real-time before each call executes.

Daily Spend Limit

Sets the maximum credits your account can spend in a single UTC calendar day. Once hit, all subsequent calls return HTTP 402 until the day resets at midnight UTC. Example: Set a $50/day limit to prevent an agent from accidentally spending more than your daily budget.

From the Dashboard

  1. Go to BillingSpending Controls
  2. Toggle on Daily Spend Limit
  3. Enter your limit in USD (e.g., 50.00)
  4. Click Save

Via API

curl -X PUT https://api.acn.exchange/v1/billing/limits \
  -H "Authorization: Bearer acn_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "dailySpendLimitUsdc": "50.00"
  }'
Response:
{
  "dailySpendLimitCredits": "50000000",
  "dailySpendLimitUsdc": "50.000000",
  "perCallLimitCredits": null,
  "perCallLimitUsdc": null
}
To remove the daily limit, pass null:
-d '{"dailySpendLimitUsdc": null}'

What Happens When the Limit is Reached

Calls are rejected with HTTP 402 before they reach the provider:
{
  "statusCode": 402,
  "code": "ACN-CREDIT-002",
  "error": "Spending Limit Exceeded",
  "message": "Daily spending limit of 50,000,000 credits ($50.00) would be exceeded.",
  "details": {
    "limitType": "daily",
    "limitCredits": "50000000",
    "currentDailySpend": "49500000",
    "requestedCredits": "2000000"
  }
}
The limit resets at midnight UTC each day.

Per-Call Limit

Blocks any single call that costs more than your threshold. Useful for preventing unexpectedly expensive capabilities from draining your balance. Example: Set a $0.50 per-call limit to ensure no single call costs more than 50 cents.

Via Dashboard

BillingSpending Controls → toggle Per-Call Limit → enter amount → Save.

Via API

curl -X PUT https://api.acn.exchange/v1/billing/limits \
  -H "Authorization: Bearer acn_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "perCallLimitUsdc": "0.50"
  }'
You can set both limits at once:
-d '{
  "dailySpendLimitUsdc": "50.00",
  "perCallLimitUsdc": "0.50"
}'

Low Balance Alert

Sends an email when your credit balance drops below a threshold. Use this to top up before calls start failing.
Alerts are sent at most once every 24 hours per threshold to avoid inbox spam.

Via Dashboard

BillingNotifications → set Low Balance Threshold (e.g., 5.00 USDC) → Save.

Via API

curl -X PUT https://api.acn.exchange/v1/billing/alerts \
  -H "Authorization: Bearer acn_sk_your_key" \
  -H "Content-Type: application/json" \
  -d '{
    "lowBalanceThresholdUsdc": "5.00",
    "emailNotifications": {
      "lowBalance": true
    }
  }'

Checking Current Limits

curl https://api.acn.exchange/v1/billing/balance \
  -H "Authorization: Bearer acn_sk_your_key"
{
  "balanceCredits": "8500000",
  "balanceUsdc": "8.500000",
  "dailySpentCredits": "1200000",
  "dailySpentUsdc": "1.200000",
  "dailySpendLimitCredits": "50000000",
  "dailySpendLimitUsdc": "50.000000",
  "perCallLimitCredits": "500000",
  "perCallLimitUsdc": "0.500000"
}

For production agents running without supervision:
# Set a $25/day daily limit and $0.10 per-call cap
# Alert when balance drops below $5
curl -X PUT https://api.acn.exchange/v1/billing/limits \
  -H "Authorization: Bearer acn_sk_your_key" \
  -d '{
    "dailySpendLimitUsdc": "25.00",
    "perCallLimitUsdc": "0.10"
  }'

curl -X PUT https://api.acn.exchange/v1/billing/alerts \
  -H "Authorization: Bearer acn_sk_your_key" \
  -d '{
    "lowBalanceThresholdUsdc": "5.00",
    "emailNotifications": {
      "lowBalance": true,
      "dailyLimitReached": true,
      "unusualActivity": true
    }
  }'
This setup:
  • Caps daily exposure at $25
  • Prevents calls to high-cost endpoints that exceed $0.10
  • Alerts you when you need to top up
  • Notifies you if usage spikes unexpectedly (potential key compromise)