Error Codes

Meida uses standard HTTP status codes. Errors include a structured JSON body with a machine-readable code, human-readable message, and optional retry_after_ms.


Status Code Reference

200OK

Request completed successfully. The response body contains the completion and router telemetry.

Action:No action needed.
400Bad Request

The request body is malformed or missing required fields (e.g., messages array is empty or model field is missing).

Action:Validate your request payload matches the Chat Completions schema.
401Unauthorized

The API key is missing, invalid, expired, or does not have permission for the requested resource.

Action:Check your Authorization header. Ensure the key starts with me_live_ or me_test_.
403Forbidden

The API key is valid but lacks permission for this action (e.g., using a me_test_ key on a production-only endpoint).

Action:Use the correct environment key for your request.
429Rate Limited

You have exceeded your tier's rate limit (requests per minute). The response includes a Retry-After header.

Action:Implement exponential backoff. Check the Retry-After header for the cooldown duration.
500Internal Server Error

An unexpected error occurred within the Meida routing engine. This is rare and typically self-recovering.

Action:Retry the request after a short delay. If persistent, contact support.
502Bad Gateway

The selected upstream provider returned an invalid response. Meida's failover engine should have rerouted automatically.

Action:Usually auto-recovered. If you see this, the fallback chain was also exhausted. Retry.
503Service Unavailable

All providers in the requested tier are currently unavailable. This triggers the full failover cascade.

Action:Meida reroutes automatically. If returned to client, all fallback nodes are down. Retry in 30s.

Error Response Format

429 Rate Limited
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "You have exceeded 1000 RPM for your current tier.",
    "type": "rate_limit_error",
    "retry_after_ms": 12000
  }
}