Skip to main content
Every request authenticates with an API key, and every key spends your one wallet. This page covers the controls that keep that safe: per-key spend limits, expirations, the disable switch, per-key usage analytics, and automatic wallet top-ups. Manage everything at dashboard → API keys, or use the endpoints below with any key or session.

Create a key

POST /v1/api-keys mints a key. The secret is returned exactly once.
All fields except name are optional: A request that would take the key past its limit is rejected with 402 and the message this API key has reached its spend limit — nothing is charged. The wallet balance still applies independently.

Update, disable, delete

POST /v1/api-keys/{id} patches a key. Send only what you want to change:
  • The limit pair travels together: changing limitInterval requires limitUsd in the same request, and "limitUsd": null clears both.
  • A disabled key fails every request with 401 (this API key is disabled) until you re-enable it with { "disabled": false }.
  • An expired key fails with 401 (this API key has expired); expiry cannot be changed after creation — mint a new key instead.
  • DELETE /v1/api-keys/{id} revokes a key permanently. This cannot be undone.

Per-key usage

GET /v1/api-keys/{id}/usage?days=7|30|90 returns one key’s spend: totals, a per-API breakdown, a daily series, and calendar totals for today, this week, and this month — all in USD.
The key list (GET /v1/api-keys) also carries each key’s 30-day usage30d ({ requests, costUsd }) plus its current-window spentUsd against limitUsd.

Auto top-up

Keep your wallet from running dry: when your balance falls below a threshold, AnyAPI charges your saved card for a fixed amount, automatically.
  • Enabling requires a saved card: make one top-up first and choose to save your payment method at checkout (hasPaymentMethod on the GET tells you where you stand).
  • Amounts are whole dollars; amountUsd respects the same minimum as a manual top-up.
  • Auto top-ups appear in your transactions like any other top-up. Burst protection prevents duplicate charges, and repeated card failures pause the feature rather than retrying forever.
  • Configure it in the dashboard under Credits → Auto top-up.