Rate limits & spend caps
Per-key request limits, per-key credit caps, IP allow-lists, and what 402 and 429 mean.
Request limits#
Every key has three request limits, counted per key:
| Window | Default |
|---|---|
| per minute | 60 |
| per hour | 3,000 |
| per day | 50,000 |
Over any of them the API answers 429 Too Many Requests with a Retry-After header (seconds until the window resets). Some actions also have per-account limits that apply whatever the key: placing phone calls (3 a minute, 30 an hour by default), for example. Need more? Contact support with your use case.
Limits are enforced even if part of our infrastructure is degraded: if the shared counter is unavailable, each API server keeps a conservative local count instead of letting requests through unlimited.
Spend caps#
A key can have a daily and a monthly credit cap. Every credit charge made through the key counts against them: generations, speech, chat turns, phone call minutes (including calls the key started that are billed when they end), campaigns and phone numbers. Refunds of unused reservations are credited back.
When a request would take the key over a cap, it is refused with 402:
{"detail": "This API key reached its daily spending cap of 5000 credits. It resets at 00:00 UTC; raise the cap in Developers → API keys."}Daily caps reset at 00:00 UTC and monthly caps on the 1st of the month (UTC). The account's own credit balance still applies: a key can never spend more than the account has. You get an email the first time a key hits its cap (at most once an hour per key).
Set caps when you create a key, or edit them in Developers → API keys.
IP allow-list#
Give a key a list of addresses or CIDR ranges (203.0.113.7, 198.51.100.0/24, 2001:db8::/32) and it only works from those. Requests from anywhere else get 403, including minting voice-session tokens. An empty list means any address.
Alerts#
VoiceMint emails the account owner (at most once per key per hour) when a key:
- buys a phone number,
- hits its spend cap,
- makes more than five times its usual hourly number of requests.
These also appear as events on the key in Developers → API keys.
Handling 402 and 429#
curl -i https://api.voicemint.io/api/v1/agents \
-H "Authorization: Bearer $VOICEMINT_API_KEY"
# HTTP/1.1 429 Too Many Requests
# Retry-After: 37A 402 is not retried: it will not succeed until credits are added, the cap is raised or the cap window resets.