Mistral API 502 Bad Gateway
The same Mistral model is reachable through La Plateforme and through several cloud marketplaces, and each one sits behind a different front door. A 502 identifies the door, not the model.
📡 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.
Affiliate link — we may earn a commission at no extra cost to you
Live Mistral status right now
Establish this first. If Mistral is genuinely degraded, the attribution work below is unnecessary and you should be failing over instead of reading response headers.
A 502 is the only 5xx that is definitionally written by someone other than the component that failed. A gateway asked an upstream for a response, got something it could not use — an empty body, a reset connection, a malformed reply — and substituted an error of its own. Everything useful about a 502 follows from that one fact: your request was fine, the model may never have seen it, and the error you are reading was authored by a middleman.
Which middleman is the entire question. It might be Mistral's own edge. It might equally be your ingress controller, a service-mesh sidecar, a corporate egress proxy, a CDN, or a routing library sitting between your code and the provider. These produce an identical status code and wildly different remediation, and teams routinely spend an incident refreshing a status page for a failure their own infrastructure emitted.
30-second triage: look at the response Content-Type. JSON with a structured error envelope means Mistral answered. HTML with a <title>502 Bad Gateway</title> and a server banner means an intermediary answered and the model tier never saw your call. If it is JSON and sustained, check live Mistral status and fail over. If it is HTML, read your own gateway logs.
502 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 that the policy is wrong for at least three of them. The column that matters is the last one, because it is the only one that changes what you do next.
| Code | Who authored it | Correct response |
|---|---|---|
429 | Mistral, deliberately, about your allowance | Slow down. Never fail over — you export your own pacing bug |
500 | The service, about an unhandled fault | Retry once or twice; a persistent 500 is a bug report |
502 | An intermediary — possibly yours | Identify the hop first, then one jittered retry |
503 | The service, about having no capacity | Retry with a budget, then fail over or degrade |
504 | An intermediary, about a deadline it set | Retry only if idempotent; consider raising the timeout |
502 and 504 are siblings and both are written by gateways — the difference is that a 504 means the intermediary waited and gave up, while a 502 means it got an answer it could not use. Neither tells you the upstream failed. The capacity case is covered separately in the Mistral 503 guide, and the throttling case in the Mistral 429 guide.
Know Which Side Wrote the 502
External checks run from outside your own network, so a gateway failure inside your infrastructure looks different from a provider edge failure — instead of identical, which is what your application logs show you.
Try Better Stack Free →Why Mistral returns 502 specifically
Mistral is distributed through more independent front doors than any other provider on this list: La Plateforme at api.mistral.ai, cloud-marketplace deployments, and self-managed endpoints running open weights. A model name like mistral-large-latest is accepted by more than one of them, so the string in your config does not identify the operator, the region, or the gateway that will answer you.
This matters for 502 more than for any other status code, because 502 is definitionally a statement made by an intermediary about an upstream it could not reach. Which intermediary spoke determines whose incident this is. A marketplace endpoint returning 502 is a statement about that marketplace’s ingress, and it will not appear on the Mistral status page no matter how long you refresh it.
Sample rather than probe once. One request cannot distinguish a total failure from the far more common partial one, and the two call for different responses:
for i in $(seq 1 10); do
curl -s -o /tmp/body -w "%{http_code} %{time_total}s %{content_type}\n" \
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}'
doneThree columns, three answers. The status code tells you whether it failed, the elapsed time tells you whether something waited before failing, and the content type tells you who wrote the error. Ten out of ten failing with a JSON body is an incident. Two out of ten failing with an HTML body is your own infrastructure having a moment, and no amount of provider failover will fix it.
The Mistral trap: two deployments, one model name, separate blast radii
The failure that costs the most time is a team failing over from a marketplace endpoint to La Plateforme, seeing the 502 clear, and recording the incident as "Mistral had a blip." It was not Mistral. The failover worked because the two paths are genuinely independent, which is the useful discovery — and it is only visible if your logs distinguish the two, which most do not because both are just "the Mistral client."
Carry the deployment identity in your telemetry as a first-class dimension: base URL, region, and whether the credential is a La Plateforme key or a cloud credential. Then a 502 sorts itself in one query. As a bonus, that same dimension is what makes deliberate cross-deployment failover possible rather than accidental, which is a genuinely strong resilience position for a provider that offers it.
The streaming case, where the 502 never reaches your status-code metrics
If you stream, a large share of your gateway failures will never be counted as 502s at all. The response headers arrived long ago with a 200; the failure happens partway through the token stream, and what your client receives is a truncated event or an HTML error fragment spliced into a channel that was expecting server-sent events. Most SDKs raise that as a decoding error, so it lands in your logs as a parse failure in the JSON layer and your Mistral error-rate panel stays flat through the entire incident.
- 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, whatever the status code said.
- Count partial responses as their own class. Not a success, not a 5xx. They behave differently and they are the metric that moves first.
- Record bytes and tokens received on failure. A stream that died at token three is a different problem from one that died at token three hundred, and only one of them is worth showing the user.
- 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 502 specifically
502s are the most retry-friendly 5xx there is — they are usually brief, usually one hop, and usually gone by the time you look. That makes blanket “never retry 5xx” advice actively wrong here. Four rules keep the retry from becoming its own incident:
- One quick jittered retry first. Randomise across the full window rather than adding a small wobble, so a fleet of clients does not resynchronise and re-burst against the first recovered backend.
- Assume the work may have happened. The gateway could not read the response; that does not mean the upstream never produced one. Send an idempotency key for anything with a side effect, and expect that a retried completion can bill twice.
- 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 — no deploy required. See the Mistral retry budget guide.
- Retry against a deadline. 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 502s persist past a handful of retries, they have stopped being transient and the failover machinery should take over — which only works if it was kept warm. The Mistral failover guide covers keeping a second path tested rather than merely configured, and the circuit breaker guide covers stopping the retries automatically.
Frequently Asked Questions
What does a 502 from the Mistral API actually mean?
It means some intermediary between your process and the model received an invalid, empty or truncated response from whatever it forwarded your request to, and wrote its own error rather than passing anything through. The crucial word is intermediary: a 502 is never authored by the component that failed, which is what makes it the hardest 5xx to attribute. Your request was almost certainly fine — 502 says nothing about your payload, your key or your model choice — so editing the request is wasted effort. The productive question is not what is wrong with the call but which hop in the path wrote the error, and that is answerable in about thirty seconds from the response itself.
How do I tell a Mistral 502 from a 502 emitted by my own proxy?
Read the content type and the body, not the status code. Mistral returns structured JSON error envelopes with recognisable fields and its own identifying response headers. Load balancers, ingress controllers, CDNs and corporate proxies return an HTML page — a short document with a title like "502 Bad Gateway" and a server banner at the bottom. If the body is HTML, the model tier never saw your request and the Mistral status page is not the document you need. That single check resolves the majority of misattributed incidents, and it costs nothing to log the first 200 bytes of every error body alongside the status code so the evidence is already captured next time.
Is a 502 the same as Mistral being down?
Not usually, and the difference matters because it changes what you should do. A genuine outage is broad, sustained and consistent across endpoints and keys. A 502 is characteristically brief, patchy and self-clearing — one hop lost one upstream connection for a moment. The test takes seconds: sample the endpoint ten times in a loop rather than once. Ten out of ten failing over several minutes is an incident and warrants failover; three out of ten failing is transient turbulence that a correct retry policy absorbs without anyone noticing. Reacting to a single 502 as though it were an outage is how teams cut over to a fallback provider for an event that had already resolved before the deploy finished.
Is it safe to retry a Mistral 502?
Safer than most 5xx, with one real caveat. A 502 is typically transient and a single retry after a short jittered delay clears it, which is why blanket "never retry 5xx" advice is wrong here. The caveat is that a 502 tells you the intermediary did not get a usable response — it does not tell you the upstream never did the work. For a chat completion that is a billing question rather than a correctness one, and it is worth knowing that a retried request can be charged twice. For anything with a side effect, propagate an idempotency key so the retry is provably the same operation rather than a second one. Cap retries against a deadline rather than a fixed count, and use full jitter so a fleet of clients does not resynchronise on recovery.
Why does a 502 show up as a JSON parse error instead of a status code in my logs?
Because of streaming. On a streamed response your client has already received a 200 and started consuming server-sent events; if a hop fails mid-stream, what arrives is either a truncated event or an HTML error fragment spliced into a stream that was expecting JSON. Most SDKs surface that as a decoding exception, so the incident lands in your logs as a parse failure and never appears in the status-code panel at all. Handle stream termination explicitly — check for the terminal event rather than assuming the iterator ending means completion — and record partial-response events as their own failure class. Otherwise your dashboards will show a healthy Mistral error rate throughout an incident your users are watching happen.
I get 502 on my Mistral marketplace endpoint but La Plateforme works — is Mistral down?
No, and the fact that one path works while the other does not is the proof. Those two routes share a model but almost nothing else: separate ingress, separate regions, separate operators and separate capacity. A 502 on a marketplace endpoint is a statement by that marketplace’s gateway that its upstream did not answer properly, and it will never show up on Mistral’s own status page. Treat this as good news architecturally — you have just demonstrated a working independent fallback path. Formalise it: record the resolved base URL on every request, keep both credentials valid and warm, and make the switch a config flip rather than an emergency code change.
Should I fail over to another provider on a 502?
Only after you know which hop wrote it, which is the whole point of the content-type check. If the 502 came from an intermediary you own — an egress proxy, a mesh sidecar, an ingress controller — failing over to a second provider routes the same traffic through the same broken hop and changes nothing except your bill and your confidence. If it genuinely came from Mistral's edge and is sustained across a sampled loop, failover is the correct response and should be a config flip you have already tested rather than a change you write during the incident. The middle case — brief and patchy — wants neither: it wants one jittered retry and no human involvement at all.
Related Mistral Guides
Catch the 502 Before Your Users Report It
API Status Check watches Mistral and the rest of your stack from outside your own network, so you find out whether the gateway that failed 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 trialStop checking — get alerted instantly
Next time Mistral goes down, you'll know in under 60 seconds — not when your users start complaining.
- Email alerts for Mistral + 9 more APIs
- $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 GuaranteeSecure 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⏳ While You Wait — Try These Alternatives
🛠 Tools We Use & Recommend
Tested across our own infrastructure monitoring 200+ APIs daily
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.”