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

Codeerrortype (OpenAI)Fix
400invalid_planβ€”Unknown subscription plan β€” pick basic, pro or max
401unauthorizedauthentication_errorCheck your API key
402insufficient_balanceinsufficient_quotaTop up your account
403ip_not_allowed / not_your_sessionpermission_error / β€”IP not allowed for this API key, or another account's web session
404not_found / key_not_foundβ€”Unknown endpoint, path, or API key
405method_not_allowedβ€”HTTP method not allowed on this endpoint
409max_keys_reachedβ€”Limit of 10 active API keys reached β€” revoke a key before creating a new one
400invalid_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
410key_value_goneβ€”This key is stored hashed: its full value is no longer retrievable β€” regenerate it or use the value shown at creation time
429too_many_attempts / upstream_rate_limitedrate_limit_errorAttempt limit reached or provider overloaded β€” wait a moment
500internalβ€”Internal error β€” retry; if it persists, contact us
502upstream_errorapi_errorProvider temporarily unavailable β€” retry with backoff
503service_misconfigured / upstream_unavailableβ€”Service temporarily unavailable
504upstream_timeoutβ€”Generation took too long β€” retry, or switch to stream:true
507storage_fullserver_errorThe 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)

errorMeaning
already_registeredAn account already exists with this address
client_not_foundAccount not found
email_requiredMissing email address
expiredVerification/reset link expired
google_not_configuredGoogle sign-in temporarily unavailable
invalid_credentialsWrong email or password
invalid_sessionUnknown or expired payment session
invalid_signatureInvalid webhook signature
min_5Top-up below the $5 minimum
no_cookie_sessionNo browser session β€” sign in again
owner_requiredAdmin-only endpoint
cannot_delete_ownerOwner account cannot be deleted
key_revokedRevoked API key β€” cannot be regenerated
no_active_subscriptionNo active subscription to cancel
session_requiredMissing session identifier
stripe_not_configuredCard payment temporarily unavailable

Integration notes

← API documentation