2xx means success, 4xx
means the request had a problem (fix it and retry), 5xx means Memic had a
problem (retry with backoff).
Error response format
Error responses are JSON with a stable shape:detail— human-readable error messagecode— stable machine-readable error code (use this for programmatic handling)request_id— opaque ID for support tickets; include it when filing issues
HTTP status codes
| Code | Meaning | What to do |
|---|---|---|
| 200 | Success | — |
| 201 | Created | — |
| 204 | No content (e.g. after DELETE) | — |
| 400 | Bad request — invalid input | Fix the request body or query params and retry |
| 401 | Unauthorized — missing or invalid API key | Check X-API-Key header |
| 403 | Forbidden — key valid but not authorized for this resource | Verify the key is bound to the correct environment |
| 404 | Not found — resource doesn’t exist or isn’t in your environment | Check the resource ID |
| 409 | Conflict — e.g. duplicate resource | Inspect the error; usually non-retryable |
| 422 | Unprocessable — request shape is valid but values are rejected | Read the detail field |
| 429 | Rate limited | Back off and retry — see Rate limits |
| 500 | Internal server error | Retry with exponential backoff; file an issue if persistent |
| 502/503/504 | Gateway/service issue | Retry with exponential backoff |
Common error codes
| Code | Status | Description |
|---|---|---|
invalid_api_key | 401 | The API key is missing, malformed, or deleted |
file_not_found | 404 | The file ID doesn’t exist in this environment |
prompt_not_found | 404 | No prompt with that name has a live version |
file_still_processing | 409 | File is not yet ready — poll /files/{id}/status |
invalid_file_type | 400 | Unsupported file extension |
file_too_large | 413 | File exceeds the upload size limit |
rate_limit_exceeded | 429 | Too many requests — back off |
Retry strategy
For5xx responses and 429, use exponential backoff with jitter:
Reporting issues
If you hit a5xx error that doesn’t resolve with retry, include the
request_id from the error response when you report it. This lets us find
the exact request in our logs.
Related
Rate limits
Limits and 429 response behavior.
Authentication
How API keys work.