Mistral API 504 Gateway Timeout

Mistral is reachable through several front doors that each impose their own deadline, so the first question about a Mistral 504 is not how long generation took but which front door started the clock.

11 min read
Staff Pick

📡 Monitor your APIs — know when they go down before your users do

Better Stack checks uptime every 30 seconds with instant Slack, email & SMS alerts. Free tier available.

Start Free →

Affiliate link — we may earn a commission at no extra cost to you

Live Mistral status right now

Settle this before anything else. A genuine Mistral incident makes the timer analysis below irrelevant — you should be failing over, not reading proxy configs.

A 504 is a statement about a clock, not about a failure. Some intermediary decided in advance how long it was willing to wait, the answer did not arrive inside that window, and the intermediary wrote an error of its own. Nothing in the status code tells you that Mistral failed. It tells you that a deadline expired, and deadlines are configuration — which means the fault is findable by reading a number rather than by guessing.

Whose clock is the whole question. It might be Mistral's edge. It might just as easily be your ingress controller, a service-mesh sidecar, a corporate egress proxy, a platform request limit, or the timeout argument you passed to your own SDK three releases ago and have not looked at since. These produce an identical status code and entirely different remediation.

30-second triage: read the elapsed time, not the status code. If your 504s cluster on a round number — 30s, 60s, 120s — that number is somebody's configured constant and your job is to find whose. If the elapsed times are scattered, something variable is being waited on. Either way, checklive Mistral statusfirst so you know whether any of this analysis is worth doing.

504 against the rest of the 5xx family

These five get filed together as “the API is broken” and then handed one retry policy, which guarantees the policy is wrong for at least three of them. The last column is the one that matters, because it is the only one that changes what you do next.

CodeWho authored itCorrect response
429Mistral, deliberately, about your allowanceSlow down. Never fail over — you export your own pacing bug
500The service, about an unhandled faultRetry once or twice; a persistent 500 is a bug report
502An intermediary, about an unusable replyIdentify the hop from the body, then one jittered retry
503The service, about having no capacityRetry with a budget, then fail over or degrade
504An intermediary, about a deadline it setFind the timer from elapsed time; retry only if idempotent

502 and 504 are the two gateway-authored codes and they are routinely conflated. The difference is simple and it changes your diagnosis: a 502 means the gateway got an answer it could not use, so the evidence is in the response body; a 504 means it got nothing and stopped waiting, so the evidence is in the elapsed time. The unusable-reply case is covered in theMistral 502 guide, the capacity case in theMistral 503 guide, and throttling in theMistral 429 guide.

📡
Recommended

Find Out Whose Timer Expired

External checks run from outside your own network on a known deadline, so a timeout inside your infrastructure looks different from one at the provider edge — instead of identical, which is what your application logs show you.

Try Better Stack Free →

Why Mistral returns 504 specifically: several front doors, several deadlines

Mistral is unusual among the open-weight providers in how many independent ways there are to reach the same model. La Plateforme is one. Azure AI Foundry is another. Bedrock, Vertex and a handful of marketplace listings are others, and self-hosted deployments of the open-weight releases are a category of their own. These share a model name and share nothing else — different edges, different capacity pools, different request deadlines, different status pages.

That matters more for 504 than for any other status code, because 504 is definitionally about a deadline, and each of those front doors sets its own. A marketplace endpoint that enforces a sixty-second request limit will return 504 on a request that la Plateforme would have completed, and la Plateforme's status page will be green throughout because nothing about the incident touched it. Teams lose entire incidents to this, refreshing a status page for infrastructure they are not using.

The long-context case is the one place where the deadline is genuinely close to the work. Mistral's larger context windows invite document-sized prompts, and prompt processing time scales with input length in a way that is easy to underestimate — a request with a hundred thousand tokens of input spends real seconds before the first output token exists. If your 504s correlate with input size rather than with time of day, you are not looking at an incident at all; you are looking at a deadline that was set for short prompts and is now being handed long ones.

Sample rather than probe once, and record all three columns. One request cannot tell a total failure apart from the far more common partial one:

for i in $(seq 1 10); do
  curl -s -o /dev/null -w "%{http_code} %{time_total}s %{content_type}\n" \
    --max-time 90 \
    https://api.mistral.ai/v1/chat/completions \
    -H "Authorization: Bearer $MISTRAL_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"model":"mistral-large-latest","messages":[{"role":"user","content":"ping"}],"max_tokens":1}'
done

The status code says whether it failed, the elapsed time says which timer expired, and the content type says who wrote the error. Set --max-time deliberately higher than the deadline you are investigating, otherwise curl becomes the shortest timer in the path and you measure your own probe instead of the system.

The Mistral trap: log the resolved endpoint, because the model name is not evidence

A config line reading mistral-large-latest tells you nothing about where the request went. The same string is valid against la Plateforme, against a marketplace listing, and against a self-hosted deployment, and those fail independently. Emit the fully-resolved base URL on every error alongside the status code — one log line, and it removes the most expensive ambiguity in the whole failure mode.

Then check the deadline that endpoint enforces, which is frequently not documented next to the model. Cloud marketplace front doors tend to impose platform-wide request limits that have nothing to do with Mistral, and those limits are usually the shortest deadline in the path — meaning they fire first and their error is the one you see.

Finally, separate your 504 metrics by input length. If the failures live entirely in the long-prompt tail, the fix is chunking the input or moving to streaming, not raising a timeout — and certainly not failing over to another provider, which will encounter the same physics with a different logo.

The streaming case, where the 504 stops happening at all

Streaming is the most underrated fix for 504s, and it works for a reason that is easy to miss: most gateway timeouts are idle timeouts rather than total-duration limits. They fire when no bytes have moved for N seconds, not when the request has been open for N seconds. A streamed response puts bytes on the wire as soon as the first tokens exist, which resets the idle timer continuously and keeps a long generation alive under a deadline that would have killed the buffered equivalent.

  • Check which kind of timeout you have. An idle timeout is defeated by streaming; a hard request-duration cap is not. They are configured separately and confusing them wastes a day.
  • Assert on the terminal event. An iterator finishing is not the same as a stream completing. If the terminal marker never arrived, the response was truncated no matter what the status code said.
  • Count partial responses as their own class. Not a success, not a 5xx. On a streamed path they are the metric that moves first, and a status-code-only dashboard stays flat through the entire incident.
  • Decide the resume policy in advance. Re-issuing the whole prompt is the honest default and it bills twice; showing the partial output with a visible label is often the better product answer.

A retry policy that fits a 504 specifically

504 is the 5xx where the standard retry advice is most likely to hurt you, because the one thing a 504 does not tell you is whether the work happened. Four rules keep the retry from becoming its own incident:

  • Assume the request may have succeeded. Your gateway stopped listening; the upstream did not necessarily stop working. Send an idempotency key for anything with a side effect, and expect a retried completion to be billable twice.
  • Do not retry into the same deadline. If the timeout was too short for this request, a second identical attempt will expire identically. Change something — stream it, shrink it, or route it to a path with a longer deadline — or do not retry at all.
  • Budget by ratio, not by count. Allow retries as a fraction of recent successes so the allowance collapses on its own when almost everything is failing, with no deploy required. See the Mistral retry budget guide.
  • Retry against a deadline, not a counter. If the user-facing request gave up eight seconds ago, attempt three is load on behalf of nobody. Propagate the deadline and skip attempts that cannot finish inside it.

If 504s persist past a couple of attempts they have stopped being transient, and the failover machinery should take over — which only works if it was kept warm. TheMistral failover guidecovers keeping a second path tested rather than merely configured, and thecircuit breaker guidecovers stopping the retries automatically.

Frequently Asked Questions

What does a 504 from the Mistral API actually mean?

It means an intermediary between your process and the model set a deadline, that deadline expired before a usable response arrived, and the intermediary wrote its own error rather than waiting longer. Two things follow, and both are frequently missed. First, the 504 was authored by whichever hop was holding the timer — which may be Mistral's edge, but may equally be your own load balancer, service mesh, egress proxy or SDK client. Second, a 504 says nothing about whether the upstream completed the work; it says only that the answer did not come back inside the window. That distinction is what makes the retry decision non-obvious.

How is a 504 different from a 502 on Mistral?

They are siblings — both are written by intermediaries, neither is authored by the component that actually failed — but they describe opposite events. A 502 means the gateway received something it could not use: an empty body, a reset connection, a malformed reply. A 504 means the gateway received nothing at all and gave up waiting. The practical difference is what you measure next. For a 502 the diagnostic signal is the response body and its content type, because that identifies the author. For a 504 the diagnostic signal is elapsed time, because the elapsed time tells you which timer expired, and timers are configuration you can find and read.

Is a 504 the same as Mistral being down?

Usually not, and the two call for opposite responses. A real outage is broad, sustained and consistent — every endpoint, every key, every request shape. A 504 is characteristically narrow: it hits the slow requests, the large requests, or the requests that traverse one particular hop, while everything else continues to work. Sample rather than infer from a single failure. Ten identical probes failing over several minutes is an incident and failover is correct; three of ten failing while the fast requests sail through is a deadline set too tight for part of your traffic, and failing over exports the problem rather than solving it.

Is it safe to retry a Mistral 504?

Less safe than a 502, and the reason is worth understanding rather than memorising. A 504 means the answer did not arrive in time — it does not mean the upstream never did the work. The request may have completed a moment after your gateway stopped listening, which for a completion is a billing question and for anything with a side effect is a correctness one. Retry only what is idempotent, or propagate an idempotency key so the second attempt is provably the same operation rather than a second one. And retry against a deadline rather than a fixed count: if the user-facing request gave up already, attempt three is load on behalf of nobody.

Why do my Mistral 504s show up as client-side timeout exceptions instead of status codes?

Because whichever timer is shortest wins, and it is often yours. If your SDK's client timeout is below the gateway's, your process abandons the request first and raises a local exception — the 504 that the gateway would eventually have written never reaches you, and your status-code dashboard stays clean through the whole incident. This is why the elapsed-time distribution matters more than the error taxonomy here. Log total elapsed time on every failure, timeouts included, and count local timeouts in the same bucket as 504s; otherwise you are measuring which timer fired rather than how often requests failed.

Mistral's status page is green but I am getting 504s — what am I missing?

Most likely that you are not talking to the endpoint the status page describes. Mistral models are served through la Plateforme and through several cloud marketplace front doors, each with its own edge and its own request deadline, and only the first of those is what la Plateforme's status page covers. A 504 written by a marketplace gateway is invisible to it by construction. Log the resolved base URL on every error: if it is not api.mistral.ai, the page you are refreshing was never going to mention your incident, and the deadline that expired belongs to the platform hosting the listing.

My Mistral 504s only happen on long documents. Is that an outage?

No, and treating it as one will waste the incident. Prompt processing scales with input length, so a document-sized prompt spends genuine seconds on input before any output token exists — and a deadline configured against short chat requests will expire during that window every single time. The signature is that the failures correlate with input size rather than with wall-clock time, which no real outage does. The fixes are streaming, so that bytes move early enough that no idle timer fires, or chunking the input so each request fits comfortably inside the deadline you actually have.

Related Mistral Guides

Know Whose Deadline Expired — Before Your Users Do

API Status Check watches Mistral and the rest of your stack from outside your own network on a known deadline, so you find out whether the timer that fired was theirs or yours — in seconds, not after twenty minutes of reading a status page that was never going to mention it.

Start Your Free Trial →

Alert Pro

14-day free trial

Stop checking — get alerted instantly

Alert Pro checks the 60+ APIs we monitor every hour and emails you within the hour of a detected change.

  • Email alerts for up to 10 of the APIs we monitor
  • $0 charged today — card required to start
  • Cancel anytime — $9/mo after trial

🌐 Can't Access Mistral?

If Mistral is working for others but not for you, it might be an ISP or regional issue. A VPN can help bypass network-level blocks and routing problems.

🔒

Troubleshoot with a VPN

Connect from a different region to test if the issue is local to your network. Also protects your connection on public Wi-Fi.

Try NordVPN — 30-Day Money-Back Guarantee
🔑

Secure Your Mistral Account

Service outages are a common time for phishing attacks. Use a password manager to keep unique, strong passwords for every account.

Try NordPass — Free Password Manager
Quick ISP test: Try accessing Mistral on mobile data (Wi-Fi off). If it works, the issue is with your ISP or local network.

⏳ While You Wait — Try These Alternatives

🛠 Tools We Use & Recommend

Tested across our own infrastructure monitoring 200+ APIs daily

SEMrushBest for SEO

SEO & Site Performance Monitoring

Used by 10M+ marketers

Track your site health, uptime, search rankings, and competitor movements from one dashboard.

We use SEMrush to track how our API status pages rank and catch site health issues early.

From $129.95/moTry SEMrush Free
View full comparison & more tools →Affiliate links — we earn a commission at no extra cost to you