Error codes

Identify and resolve technical incidents quickly. This section lists AlphaEdge API error codes, their causes and the recommended fixes.

Headers present on every error

  • X-Request-ID — unique identifier present on every response (auto-generated or echoed from the client value). Share it with support to ease server-side correlation. On a 500 error, the identifier is also duplicated in the JSON body: {"detail": "...", "request_id": "..."}.
  • Retry-After — present on 429, 502, 503 and 504 responses. Indicates the recommended wait time (in seconds) before retrying. Honor this value client-side (backoff).

Error messages emitted by the gateway are in French. A few default 404 / 405 messages ("Not Found", "Method Not Allowed") remain in English — these are the FastAPI defaults.

List of error codes

400

Requête mal formée

Cause : Invalid request body format (rare: the gateway prefers 422 for incorrect parameters).

Solution : Vérifiez que le corps respecte le content-type annoncé. Pour les requêtes multipart, laissez le client (curl -F, requests, fetch+FormData) générer le boundary.

401

Authentification échouée

Cause : Clé API absente, vide ou invalide.

Message typique : {"detail": "Clé API manquante : fournissez l’en-tête X-API-Key ou Authorization: Bearer <clé>."}

Solution : Check your key. Two headers are accepted: X-API-Key: TA_CLE or Authorization: Bearer TA_CLE. Si vous n'en avez pas, créez une clé sur votre tableau de bord.

402

Insufficient balance

Cause : The account balance is not enough to cover the request's estimated cost.

Solution : Top up your account from the dashboard. You can also check your usage via GET /account/usage.

403

Forbidden

Cause : Forbidden host: raw IP call, wrong domain, or attempt to reach an internal route (e.g. GET /health) from the outside.

Message typique : {"detail": "Utiliser le nom de domaine « api-endpoints.alphaedge-ai.com » dans l’URL…"}

Solution : Always call the API via the public domain https://api-endpoints.alphaedge-ai.com.

404

Resource not found

Cause : Unknown model slug, unknown job identifier, or unrouted URL.

Messages typiques :

  • {"detail": "Modèle introuvable."}
  • {"detail": "Job de transcription introuvable."}
  • {"detail": "Not Found"} (FastAPI fallback for unrouted URLs)

Solution : Check the model slug (catalog via GET /models) and the URL shape (method, path, path parameters).

405

Method not allowed

Cause : The HTTP method is not supported on this route (e.g. GET on a POST-only endpoint).

Solution : Check the response header Allow which lists the methods accepted on the route.

422

Paramètres invalides

Cause : The multipart contains unauthorized fields, the required file is missing or empty, or a boolean value is not in the accepted set.

Exemples de messages :

  • {"detail": "Champ booléen invalide pour `enable_diarization`: 'banane'. Valeurs acceptées : 1/0, true/false, yes/no, on/off."}
  • {"detail": "Formulaire multipart invalide : champs autorisés = `audio` (fichier requis), `enable_diarization`, `enable_postcorrect`. Tout autre champ est refusé."}
  • {"detail": "Fichier audio illisible ou format non reconnu."}

Solution : Adjust the form to match the returned message: exact field name (audio / image), boolean values among 1/0, true/false, yes/no, on/off.

429

Trop de requêtes

Cause : Rare today (no application rate-limit on the gateway). May be returned by upstream network layers if a protection is enabled.

Solution : Honor the header Retry-After returned (5 s by default). Implement exponential backoff with jitter for retries.

500

Internal server error

Cause : Le serveur rencontre un problème non rattrapé.

Solution : Retry after a short wait. The JSON body includes a field request_id (identical to the header X-Request-ID) — share it with support to ease investigation.

502

Erreur de service en aval

Cause : The upstream service (ASR or OCR) returned an error the gateway can't map to an application code.

Solution : Retry; a header Retry-After (5 s) accompanies the response. If the problem persists, contact support with the X-Request-ID.

503

Service indisponible

Cause : Startup in progress, overload or punctual maintenance.

Solution : Honor the header Retry-After (10 s by default). On traffic spikes, implement exponential backoff with jitter.

504

Upstream timeout

Cause : The gateway couldn't reach the key verification service or an upstream service in time.

Solution : Retry after Retry-After (5 s). If the problem persists, contact support with the X-Request-ID.

Best practices

To avoid errors and improve your application's robustness:

  • Error handling : Catch all 4xx and 5xx codes and inspect the field detail of the JSON body for an explicit (French) message.
  • Retry logic : On 429 / 502 / 503 / 504, honor the header Retry-After. Otherwise, use exponential backoff with jitter.
  • Validation : Validez vos paramètres avant l'envoi pour éviter les 422.
  • Traçabilité : Conservez le header X-Request-ID returned on every response. To pre-generate a client identifier, send your own X-Request-ID upstream: it will be echoed back in the response.
  • Monitoring : Surveillez votre solde régulièrement via GET /account/me to avoid 402s.