Errors
Every HTTP status the API returns, what it means and what to do about it.
Errors are JSON with a detail field: a sentence for people, or for 422 a list of the fields that failed.
{"detail": "Not enough credits for this request"}Status codes#
| Status | Meaning | What to do |
|---|---|---|
400 | The request is malformed or makes no sense (for example an unsupported audio format). | Fix the request; detail says what is wrong. Do not retry as is. |
401 | Missing, wrong, revoked or expired API key. | Check the Authorization: Bearer vm_sk_… header and that the key is active in the console. |
402 | Payment required: the account does not have enough credits, or the key reached its daily or monthly spend cap. detail says which. | Top up credits, raise the key's cap, or wait for the cap to reset (daily caps reset at 00:00 UTC, monthly on the 1st). |
403 | Forbidden: the route is not available to API keys, the key lacks the permission (for example agents.write, or numbers.purchase to buy numbers), the key's IP allow-list does not include this client, or the account is inactive. | Use a key with the right permission, call from an allowed address, or use the web app for account and billing actions. |
404 | The thing does not exist for this account (another account's ids look the same as missing ones). | Check the id and which account / workspace the key belongs to. |
409 | Conflict with the current state: a campaign that cannot be started in its status, an idempotent request still running, a duplicate. | Read the state again, then decide. For idempotency conflicts, retry later. |
413 | The upload is too large. | Stay under the endpoint's limit (25 MB for most audio). |
422 | Validation failed: a required field is missing, a value is out of range, a phone number is not E.164. detail lists each failing field. | Fix the fields. |
429 | Too many requests: over the key's per-minute, per-hour or per-day limit, or a per-account limit such as calls per minute. The response has Retry-After (seconds). | Wait Retry-After seconds, then retry. Spread requests out. |
500 | An unexpected error on our side. | Retry with backoff; contact support with the time and path if it persists. |
502 / 503 / 504 | A provider or service is temporarily unavailable or timed out. | Retry with backoff. |
The SDKs raise a typed error per status: AuthenticationError (401), InsufficientCreditsError (402), PermissionDeniedError (403), NotFoundError (404), ValidationError (422), RateLimitError (429, with retry_after) and InternalServerError (5xx).
# inspect status and body
curl -i https://api.voicemint.io/api/v1/agents/does-not-exist \
-H "Authorization: Bearer $VOICEMINT_API_KEY"Live voice close codes#
WebSocket sessions close with codes instead of statuses: 4401 (bad or used token / key), 4402 (out of credits or spend cap), 4403 (permission, IP or wrong agent), 4404 (agent or meet not found), 4429 (rate limited or voice capacity full). See Live voice.