Conclusion first: a bare 401, 404, or 502 doesn't tell you much — the useful signal is that one line of message in the body. We replayed every class of error against the LONG AI gateway, and 404 alone had three completely different causes, one of which is caused by your own account settings. Guessing from the status code alone usually points you the wrong way and makes you change the wrong thing.
Every response below was captured live on 2026-11-03, unedited.
A request passes three gates, and which gate the error lands in decides who has to fix it. Plenty of people see 404 and go hunting through model names, when really the path was wrong all along.

Stage one checks your key, format, and path — all on your side. Stage two picks a seller by model name; a typo, an overly strict threshold, or nobody currently selling all stall right here. Stage three has already forwarded to the seller's upstream — it's out of your hands; you can only switch channels or wait.
The image below shows each error replayed live. Focus on the three 404 lines: a wrong path is a plain-text 404 page not found with no JSON at all; a misspelled model name is is not available; and a name that's on the plaza but has no seller right now is is currently unavailable: no upstream provider serves it.

Here's a handy discriminator: check whether the body is JSON. Plain text means the request never reached business logic — it's a path or method mistake, 100%. JSON means it got into the gateway, and only then do you look at the message.
And a more counter-intuitive one: a wrong parameter type doesn't return 400 — it returns 502. We tried writing max_tokens as the string "abc", temperature in Chinese, top_p as "high", and max_tokens as a boolean — all four came back 502 Upstream request failed. The same model, same minute, with correct parameters, returned 200 immediately. So a good chunk of 502s are your own parameter problem, not a dead upstream.
This is the most valuable one to remember, from a real investigation: same body, same model name, only the key changed — one returned 200, the other 404.

404 literally reads "upstream doesn't have this model," but the server log tells the real story:
no available OpenAI accounts supporting model: gemini-3.6-flash
(pool=36, filtered: account_model_not_owned=17 model_unavailable=8 over_price_cap=1)
The key is that last over_price_cap=1 — it exceeded the price cap. This key was set to "only accept the cheapest tier," and this model's current discount didn't meet the bar, so it got filtered out by its own rule. When filtering leaves zero, the system reports a generic 404 worded as "upstream out of stock."
So when you see no upstream provider serves it, the first thing to check isn't the upstream — it's your key's discount threshold.
The most practical point in this article, and the easiest to trip over: the model plaza is a listing, not a callable inventory. Someone can pull their listing and the name stays up.
How to tell: every plaza row has three columns — lowest market price, highest discount, and sellers. When "sellers" shows 0 and the other two show "—", nobody is selling it right now.
We pulled 20 "no seller, no price" names out of the plaza's 190 models, randomly picked 4 and called each twice — all 8 calls failed, not a single 200 (4× 503, 1× 404, 3× timeout). At the same moment, 2 models with sellers and prices both returned 200. It's not chance; it's the difference between in-stock and out-of-stock.
So don't treat the plaza as proof that something works. Check the seller count and price before you write code, and fire one manual call before a batch run. That ten seconds saves you a midnight session wondering why everything 404'd overnight.
1. 401 API_KEY_REQUIRED
Cause: no key in the request header.
Fix: add Authorization: Bearer sk-xxx — note it's Bearer plus one space, not a colon.
2. 401 INVALID_API_KEY
Cause: wrong key, usually from an extra space or newline while copying.
Fix: recopy and check for stray whitespace at either end; don't use a key read from a screenshot.
3. 400 Failed to parse request body
Cause: the body isn't valid JSON — single quotes, a trailing comma, or full-width quotes.
Fix: run it through a JSON validator; if you're hand-building strings, serialize with a json library instead.
4. 400 model is required
Cause: no model field, or it's a number.
Fix: model must be a string, not 123.
5. 404 page not found
Cause: wrong path — the request never reached business logic.
Fix: make sure it's /v1/chat/completions; one missing "s" gives you this exact line.
6. 404 is not available
Cause: the model name genuinely doesn't exist or is misspelled; the gateway doesn't recognize it.
Fix: copy the exact name from the model plaza.
7. 404 no upstream provider serves it
Cause: the name is recognized but no seller is available right now; or your key's discount threshold filtered it out.
Fix: check the seller count on the plaza first, then your key's threshold.
8. 429 rate_limit_error
Cause: every upstream channel is throttling, not your account being banned.
Fix: wait a few seconds and retry with exponential backoff; no config change needed.
9. 502 Upstream request failed
Cause: suspect yourself first — in testing, a wrong parameter type produced exactly this code.
Fix: fix each parameter's type and retry; if the types are right and it still 502s, then it's upstream.
10. 503 Service temporarily unavailable
Cause: this model has zero available sellers right now, but the config is correct.
Fix: retry later, or switch to a sibling model.
404 page not found means the route never matched — go straight to the path. JSON means read the message.parse / required is a body problem; is not available is an unrecognized name; no upstream is stock or threshold; rate-limited is upstream throttling; Upstream request failed — check your parameter types first.The core of it: figure out whose responsibility it is before deciding what to change. Treating an upstream problem as your own and editing config is the most common waste of time. Model names and prices follow the model plaza in real time — verify before you integrate, and you'll dodge most of the post-hoc debugging.
GPT-6.2 cuts list prices 20%, yet platform discounts run deeper: gpt-6-astra trades at under 1% of list. What this week's AI price war means for buyer
Prompt caching stores a repeated prompt prefix and bills cache reads at 5-12% of normal input. Real prices, hit conditions, and how to cut your API bi
Twelve Claude versions are on sale. The newest opus-5-5 costs $8.91 a month; the oldest opus-4-6 costs $49.50. Full table and a pick for each workload
gpt-5.6-terra and deepseek-v4.1-flash win on price and reliability; gemini-3.8-flash is fastest. Effective prices, measured speed, and a three-tier pi
Point your base URL at the platform and one key covers all 138 on-sale models across 51 vendors, in both OpenAI and Anthropic request formats. Copy-pa