Skip to main content
Every request authenticates with an API key, and every key spends one account’s balance. Manage keys at dashboard > API keys, or call the endpoints below with any key or session.

Keys belong to an account

A key spends the account it was created in: your personal account, or a Team. Switching accounts in the dashboard doesn’t move a key. To spend a Team’s balance, switch to the Team and create the key there. Team keys belong to the Team, not to the person who made them. They keep working when that person leaves the Team; rotate any key a departing member could see. On a Team, the key list shows who created each key. On a Team, your role decides whether you can see and manage keys, and a Developer manages only Run APIs and View account keys.

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, and nothing is charged. The wallet balance applies independently.

Access levels

Pick an access level when you create a key in the dashboard. It can’t be changed later; create a new key instead. Keys created before access levels existed have Full access. Every level can send feedback and bug reports. A key that calls something outside its access gets 403 with error code forbidden. The same limits apply through the MCP server. Give CI or an agent a Run APIs key, and a finance dashboard a View account key. On a Team, keys can’t have View seller earnings access, and no key reaches referral earnings. Selling and referrals are personal-only.

Rotate a key

If a secret may have leaked, rotate the key. Open the key’s page in dashboard > API keys and choose Rotate key under Danger zone.
  • The new secret is issued immediately and shown once.
  • The old secret stops working on its next request. There is no grace period, so update anything that uses it right away.
  • The name, spend limit, amount spent, usage history, and access level stay the same.
Deleting is different: it ends the key for good, and a replacement key starts with fresh limits and empty history.

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.

When your balance runs out

When your balance can’t pay for a request, it fails with 402 insufficient_balance and nothing is charged. AnyAPI emails you when your balance runs low and again when it runs out. If a key keeps calling 48 hours or more after your balance ran out, AnyAPI pauses that key. A paused key fails with 402 insufficient_balance and the message this API key is paused because your balance ran out; it resumes when you add funds, and shows Paused in dashboard > API keys. A connected app (such as an MCP client you authorized) pauses the same way, with the message this connection is paused because your balance ran out; it resumes when you add funds. AnyAPI emails you when it pauses a key or app. Only the key or app that kept calling is paused; your other keys and your account are unaffected. Once you add funds and your balance can pay for requests again, the key or app resumes on its own. You don’t need to change anything.

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.

Manual top-ups

Add between $10 and $10,000 from Credits > Buy credits in the dashboard. Every dollar you pay adds one dollar to your wallet, with no top-up fee. You pay on Stripe’s hosted checkout page, where you can use a saved payment method or save a new reusable one. Your wallet updates only after AnyAPI receives the verified payment event. Some payment methods settle later; the dashboard shows a delayed state until the top-up lands. Successful full and partial refunds reduce the wallet by the refunded amount. A dispute reduces the wallet when it opens, even when that makes the balance negative. Winning the dispute restores the disputed amount; losing it does not apply another debit.

Auto top-up

When your balance falls below a threshold, AnyAPI charges your saved card a fixed amount.
  • Enabling requires a saved reusable payment method. Make a manual top-up first and select Stripe’s save option (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.