API Error Codes
Every code the MIBIV API can return, what it means and how to fix it. Messages are English by default, and French when your client sends Accept-Language: fr.
Overview
| Code | error | type (OpenAI) | Fix |
|---|---|---|---|
| 400 | invalid_plan | β | Unknown subscription plan β pick basic, pro or max |
| 401 | unauthorized | authentication_error | Check your API key |
| 402 | insufficient_balance | insufficient_quota | Top up your account |
| 403 | ip_not_allowed / not_your_session | permission_error / β | IP not allowed for this API key, or another account's web session |
| 404 | not_found / key_not_found | β | Unknown endpoint, path, or API key |
| 405 | method_not_allowed | β | HTTP method not allowed on this endpoint |
| 409 | max_keys_reached | β | Limit of 10 active API keys reached β revoke a key before creating a new one |
| 400 | invalid_json / payload_too_large | β | Invalid JSON body, or body too large (limit 1 MB, 8 MB on /v1/chat) β shrink the request or send valid JSON |
| 410 | key_value_gone | β | This key is stored hashed: its full value is no longer retrievable β regenerate it or use the value shown at creation time |
| 429 | too_many_attempts / upstream_rate_limited | rate_limit_error | Attempt limit reached or provider overloaded β wait a moment |
| 500 | internal | β | Internal error β retry; if it persists, contact us |
| 502 | upstream_error | api_error | Provider temporarily unavailable β retry with backoff |
| 503 | service_misconfigured / upstream_unavailable | β | Service temporarily unavailable |
| 504 | upstream_timeout | β | Generation took too long β retry, or switch to stream:true |
| 507 | storage_full | server_error | The server cannot save the request (storage full) β retry later |
401 β API key missing or invalid
{
"error": "unauthorized",
"type": "authentication_error",
"code": "unauthorized",
"message": "API key missing or invalid. Get your key at https://mibiv.com/compte."
}
Fix: the header must be Authorization: Bearer miv_β¦. Get (or regenerate) your key in your member area.
402 β Balance depleted
{
"error": "insufficient_balance",
"type": "insufficient_quota",
"code": "insufficient_balance",
"message": "Balance depleted: top up your account at https://mibiv.com/compte to continue.",
"detail": "Insufficient balance ($0). Top up from your MIBIV member area β minimum top-up $5, credited immediately after payment.",
"action": "topup_account",
"topup_url": "https://mibiv.com/compte/",
"docs_url": "https://mibiv.com/docs-errors",
"balance_usd": 0,
"topup_choices": [5, 10, 20, 50, 100, 200, 500, 750, 1000]
}
Fix: top up your account β credit is instant, your key works again without any change. An email is sent when your balance drops below $1 (at most once every 7 days).
429 β Too many attempts
{
"error": "too_many_attempts",
"type": "rate_limit_error",
"code": "too_many_attempts",
"message": "Too many sign-in attempts. Wait a few minutes and try again."
}
Fix: this code covers website sign-in attempts (anti brute-force). Wait a few minutes.
502 β Provider temporarily unavailable
{
"error": "upstream_error",
"detail": "le fournisseur est momentanΓ©ment indisponible"
}
Fix: retry with backoff (1 s, 2 s, 4 sβ¦). This error never charges your balance.
504 β Generation took too long
{
"error": "upstream_timeout",
"detail": "The generation took too long upstream. Retry the request, or use stream:true so tokens arrive as they are generated.",
"retryable": true
}
Fix: for long generations (large max_tokens, detailed answers), use stream:true β tokens arrive as they are generated and the connection cannot expire. In non-streaming mode, the full response must complete within ~2 minutes. This error never charges your balance.
Web / account endpoint errors (outside the LLM API)
| error | Meaning |
|---|---|
already_registered | An account already exists with this address |
client_not_found | Account not found |
email_required | Missing email address |
expired | Verification/reset link expired |
google_not_configured | Google sign-in temporarily unavailable |
invalid_credentials | Wrong email or password |
invalid_session | Unknown or expired payment session |
invalid_signature | Invalid webhook signature |
min_5 | Top-up below the $5 minimum |
no_cookie_session | No browser session β sign in again |
owner_required | Admin-only endpoint |
cannot_delete_owner | Owner account cannot be deleted |
key_revoked | Revoked API key β cannot be regenerated |
no_active_subscription | No active subscription to cancel |
session_required | Missing session identifier |
stripe_not_configured | Card payment temporarily unavailable |
Integration notes
error,typeandcodeare stable β rely on them, not on message wording.messageanddetailfollow theAccept-Languageheader (English default, French forfr).- The 402 exposes
topup_choices(allowed top-up amounts) andtopup_urlβ handy to add a "Top up" button in your app. - 502/503/504 errors never consume your balance.
stream:trueis strongly recommended: progressive response, no timeout on long generations.- Upstream errors (429/5xx) are returned with a clean, localized body β the provider's HTTP status is preserved.