Errors and rate limits
The error body, status codes you should handle, plan limits and the per-key rate limit headers.
A request that fails returns an HTTP status code of 400 or higher and a JSON body that explains why. This page shows what the body looks like, which status codes your code should handle, and how the rate limits work.
Error body
Every error body has a detail field. Its type depends on the kind of error:
| Kind | detail is | Example |
|---|---|---|
| Most errors | A message (string) | {"detail": "API key revoked"} |
Validation errors (422) | A list of objects with loc, msg and type | {"detail": [{"loc": ["body", "name"], "msg": "Field required", "type": "missing"}]} |
| Errors your code should branch on | An object with code and message | {"detail": {"code": "email_unverified", "message": "Verify your email address to continue."}} |
Messages are written for people and can change. Do not match on message text. Where a code exists, match on that. Otherwise use the status code.
Status codes
| Status | Meaning | What to do |
|---|---|---|
400 | The request is well formed but not acceptable. The message says why. | Fix the request. Do not retry unchanged. |
401 | The credential is missing, invalid, expired or revoked. | Sign in again or create a new key. See Authentication. |
402 | A plan limit was reached (see Structured errors). | Free up space or upgrade the plan. |
403 | The credential is valid but not allowed: the key lacks a scope, your role is too low, the action needs a session, or the email is not verified. | Use a key with the right scope or a user with the right role. |
404 | Not found, or not visible to you. mlflow never confirms that another organisation's id exists. | Check the id and your access. |
409 | The request conflicts with the current state. Examples: the deployment is not active, or an Idempotency-Key is still being processed. | Change the state, or wait and retry. |
413 | An uploaded file is too large. | Send a smaller file. |
415 | The file type is not supported (for batch predictions, use .csv, .xlsx or .parquet). | Convert the file. |
422 | Validation failed, or an Idempotency-Key was reused with a different request. | Fix the request. |
429 | Too many requests. | Wait Retry-After seconds, then retry. |
503 | A dependency is unavailable. The idempotency key store is one example. | Retry after the Retry-After delay. |
Treat every other 5xx as a temporary server problem and retry with a delay, as described in Retrying safely.
Structured errors
Two errors carry an object in detail so that a client can react to them.
Email not verified. Status 403, code: "email_unverified". The web app uses it to show its verification screen. See Authentication.
Plan limit. Status 402, code: "plan_limit". It appears on hosted plans when an action would exceed the limits of the workspace's plan:
{
"detail": {
"code": "plan_limit",
"limit": "datasets",
"current": 10,
"max": 10,
"plan": "free",
"message": "Limit reached — Datasets: 10 of 10 on the Free plan. Upgrade on the Usage & plan page."
}
}limit is one of dataset_size, datasets, storage, concurrent_trials, members and gpu. current and max are counts, or bytes for dataset_size and storage. The limits depend on the plan; see Usage & plan in the workspace settings. A self-hosted server has no plan limits. The numbers in the example are only an illustration.
Rate limits
mlflow limits how fast a client can send requests. All limits use a sliding window. The operator of a self-hosted server can change them; the values below are the defaults.
API keys
Requests made with an API key are limited per key: 600 requests per 60 seconds. Requests made with a session token are not counted against this limit.
Every response to a request made with an API key carries three headers:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed per window |
X-RateLimit-Remaining | Requests left in the current window |
X-RateLimit-Reset | Seconds until a slot frees up |
When the window is full, the API answers 429 with the message "API key rate limit exceeded", the same three headers and a Retry-After header with the number of seconds to wait.
Other limits
These protect sign-in and public endpoints. A limited request gets 429 with Retry-After; these responses do not carry the X-RateLimit-* headers.
| What | Default |
|---|---|
| Sign-in | 10 per minute per IP address; 5 per minute per email and IP address |
| Sign-up | 5 per hour per IP address |
| Password reset | 5 per hour per IP address; 3 per hour per email address |
| Email verification | 10 per hour per IP address; 3 per hour per email address |
Public endpoints (public access mode) | 60 predictions per minute per IP address |
| AI advisor | 30 requests per 5 minutes per user |
Retrying safely
A good client retries only what is safe to retry.
429: wait for the number of seconds inRetry-After, then retry. Any method can be retried, because the request was not processed.503,500,502,504: wait, with exponentially growing delays and some random jitter, then retry. Retry only requests that are safe to repeat:GET,PUT,DELETE, andPOSTrequests that carry anIdempotency-Key. Without the key, a retry of aPOSTthat timed out could create the same run or job twice.409withRetry-After: the first request with this idempotency key is still running. Wait and retry with the same key.400,401,403,404,422: do not retry unchanged; the result will be the same.- Watch the headers. Slow down when
X-RateLimit-Remaininggets close to zero, instead of waiting for a429.
Build these rules into your HTTP client. Pagination and idempotency explains the idempotency key.
Related
Updated 2026-11-22