mistralM

Docs

sideBar

Error glossary

Look up the HTTP status codes and error codes returned by the Mistral API, what causes them, and how to resolve each one.

Here are the HTTP status codes and error codes returned by the Mistral API, their meanings, and how to resolve them. Most error responses include a four-digit code and a type that name the exact cause. Common error codes lists the codes reported most often.

Client errors (4xx)

400: Bad request

A 400 error means the request is malformed, or it contains a value that the model or endpoint doesn't accept. The message field describes the problem.

Common causes:

  • Invalid JSON syntax
  • A missing model field (code 1500, Missing model parameter.)
  • An unknown or misspelled model name (code 1500, Invalid model: <name>)
  • An argument value the model doesn't support, such as too many images or an unsupported reasoning_effort value (code 3051)
  • temperature set to 0 while top_p is below 1 (code 3054, top_p must be 1 when using greedy sampling.)
  • A prompt longer than the model's context window (code 3059)

Resolution: Read the message and code fields, then check your request body against the API reference. Validate JSON before sending.

  • 1500: check the model field. To list the models you can use, call GET /v1/models on the same endpoint.
  • 3054: send top_p: 1 with temperature: 0. Do this even if your request doesn't set top_p, because some models default to a value below 1.

401: Unauthorized

A 401 error means the API key is missing, invalid, or expired. For a missing or invalid key, the response body is {"detail": "Invalid API Key"}, with no code field.

Common causes:

Resolution: Verify your API key in Studio › API keysarrowUpRight. Admins can review every key in the Organization in Admin Panel › API › API KeysarrowUpRight. Ensure the header format is Authorization: Bearer YOUR_API_KEY. Billing problems return 402, not 401.

402: Payment required

A 402 error means a billing condition on your Organization blocks the request. The message and code fields say which one.

Common causes:

  • The prepaid credit balance has reached zero (code 2308, Out of credits. Top up your balance to restore access.)
  • Included monthly usage is exhausted and pay-as-you-go isn't enabled (code 2303, API budget exhausted.)
  • The Vibe Code budget included in your plan is exhausted (code 2304, Vibe budget exhausted.)
  • A recent invoice payment failed (code 2302, Please resolve your last payment failure to restore access.)
  • A monthly spending limit is reached (code 2300 for the Organization, 2301 for a Workspace)

Resolution: Read the message: it says which condition applies. Then:

403: Forbidden

A 403 error means your account does not have permission to access the requested resource.

Common causes:

  • Accessing a model not available on your subscription tier
  • Attempting to delete a base model
  • Workspace-level permissions restricting access

Resolution: Check your subscription tier and model access. Contact your workspace admin if you believe this is an error.

404: Not found

A 404 error means the requested resource does not exist.

Common causes:

  • Invalid endpoint path or resource ID
  • Referencing a deleted file, job, or conversation
  • Typo in the URL

Resolution: Verify the resource ID and endpoint path. Use the list endpoints to confirm the resource exists. An unknown model name in the request body returns 400 with code 1500, not 404. If a 404 message names a model you didn't request, contact supportarrowUpRight.

422: Validation error

A 422 error means the request is well-formed JSON, but a field is missing or has a value the endpoint doesn't accept.

Common causes:

  • A missing required field, such as messages (Field required)
  • Wrong data type for a field, for example a string instead of a number
  • Enum value not in the allowed set
  • A field the endpoint doesn't accept, such as store sent by some OpenAI clients (Extra inputs are not permitted)
  • Array length exceeding limits

Resolution:

  • Read the detail list in the response body. In each item, loc names the field and msg says what's wrong.
  • Add, fix, or remove that field, and check it against the API reference.

429: Too many requests

A 429 error means you exceeded a rate limit, or the model is out of capacity. The code field says which.

Common causes:

  • Your Organization sent more requests or tokens than the model's rate limit allows (code 1300, Rate limit exceeded)
  • Your Organization is on Free mode, where the main chat models have a limit of 0 (code 1300, and the x-ratelimit-limit-req-minute response header is 0)
  • The model is out of capacity, which isn't your rate limit (code 3505 or 3801, Not enough capacity available for this request, please retry later.)
  • Concurrent request limit reached

Resolution:

  • Check the Retry-After response header, and the x-ratelimit-limit-* and x-ratelimit-remaining-* headers to see which limit you hit. Limits can apply per second, per minute, or per month. Find your limits in Admin Panel › API › LimitsarrowUpRight.
  • For per-second and per-minute limits and for capacity errors, retry with exponential backoff. A monthly limit or a limit of 0 doesn't clear by retrying.
  • On Free mode, enable pay-as-you-go.
  • For sustained high throughput, use batch processing. For higher limits, see Request higher limits.

Server errors (5xx)

500: Internal server error

A 500 error means an unexpected error occurred on the server side.

Resolution: Retry the request after a brief delay. If the error persists, check status.mistral.aiarrowUpRight or contact supportarrowUpRight.

502: Bad gateway

A 502 error means the server received an invalid response from an upstream service.

Resolution: Wait 30 to 60 seconds and retry. This is typically transient.

503: Service unavailable

A 503 error means the service is temporarily overloaded or under maintenance, or the model is out of capacity. Capacity errors carry code 3505 or 3801.

Resolution: Retry with exponential backoff. Check status.mistral.aiarrowUpRight for ongoing incidents. If the model is out of capacity, you can also switch to another model for a while.

504: Gateway timeout

A 504 error means the request took too long to process.

Common causes:

  • Very long prompts or high max_tokens values
  • Server under heavy load

Resolution: Reduce input size or max_tokens. If using streaming, ensure your client handles the connection properly. Retry after a brief delay.

Error response format

Most errors return a JSON body with this structure:

{
  "object": "error",
  "message": "Rate limit exceeded",
  "type": "rate_limited",
  "param": null,
  "code": "1300",
  "raw_status_code": 429
}

Field

Description

messageHuman-readable error description
typeThe error's name, such as rate_limited, invalid_model, or billing_wallet_depleted
paramThe parameter that caused the error (if applicable)
codeA four-digit error code, sent as a string. See Common error codes.
raw_status_codeThe HTTP status code

Some responses use a different shape:

  • 401 errors return {"detail": "Invalid API Key"}. See 401: Unauthorized.
  • 422 validation errors return {"detail": [...]}, with one item per invalid field. See 422: Validation error.
  • Agents and Conversations errors have "object": "Error", "type": "invalid_request_error", and a numeric code.
  • The OpenAI-compatible endpoint wraps the error in an error object, as OpenAI clients expect.

Common error codes

The code field names the exact cause of an error. This table lists the codes reported most often. It isn't a complete list: if you get a code that isn't listed and the message doesn't explain it, contact supportarrowUpRight with the full error body.

Code

Status

type

Message

What to do

1000500 or 503internal_server_errorService unavailable.Retry with backoff. Check status.mistral.aiarrowUpRight.
1100503unreachable_backendInternal server errorRetry with backoff. Check status.mistral.aiarrowUpRight.
1300429rate_limitedRate limit exceededRetry with backoff. If the x-ratelimit-limit-req-minute header is 0, enable pay-as-you-go. See 429.
1500400invalid_modelInvalid model: <name> or Missing model parameter.Check the model field. List available models with GET /v1/models.
2300402billing_customer_monthly_spending_limit_reachedCustomer monthly spending limit reached. Increase your limit to restore access.Ask an admin to raise the Organization limit, or wait for next month.
2301402billing_workspace_monthly_spending_limit_reachedWorkspace monthly spending limit reached. Increase your workspace limit to restore access.Ask an admin to raise the Workspace limit, or wait for next month.
2302402billing_payment_failurePlease resolve your last payment failure to restore access.Update the payment method, then pay the failed invoice.
2303402billing_api_budget_exhaustedAPI budget exhausted.Enable pay-as-you-go with a positive credit balance.
2304402billing_vibe_budget_exhaustedVibe budget exhausted.Wait for your included usage to reset.
2308402billing_wallet_depletedOut of credits. Top up your balance to restore access.Add credits, or turn on auto recharge.
3051400invalid_request_invalid_argsNames the argument and the problemChange the argument named in the message.
3054400invalid_request_greedy_samplingtop_p must be 1 when using greedy sampling.Send top_p: 1 with temperature: 0.
3059400invalid_request_prompt_too_longPrompt <N> > <M> maximum context lengthShorten the input or split it.
3505429backend_out_of_capacityNot enough capacity available for this request, please retry later.Retry with backoff, or use another model for a while.
3505503internal_server_errorService unavailable.Retry with backoff, or use another model for a while.
3800503internal_server_errorService unavailable.Retry with backoff.
3801429backend_out_of_capacityNot enough capacity available for this request, please retry later.Retry with backoff, or use another model for a while.
3801503internal_server_errorService unavailable.Retry with backoff, or use another model for a while.

For transient errors (429, 500, 502, 503, 504), implement exponential backoff:

import time
import random
from mistralai.client import Mistral

client = Mistral(api_key="YOUR_API_KEY")

def call_with_retry(func, max_retries=5):
    for attempt in range(max_retries):
        try:
            return func()
        except Exception as e:
            if attempt == max_retries - 1:
                raise
            wait = (2 ** attempt) + random.uniform(0, 1)
            time.sleep(wait)
lightbulb

The official Python and TypeScript SDKs include built-in retry logic with exponential backoff. Use the SDKs to avoid implementing this yourself.