Home → Help
Five errors cover almost everything people hit here. One check narrows any of them down in a few seconds.
| Error | What it usually means |
|---|---|
| Unexpected token '<' when calling an OpenAI-compatible API | Your client received HTML where it expected JSON — almost always a URL that resolves to a web page rather than an API endpoint. |
| 401 invalid API key — when the key looks right but still fails | The key is wrong, revoked, or the account is out of balance. This one does appear in your usage log, which is how you tell it apart from a path mistake. |
| 404 on /v1/chat/completions when the endpoint clearly exists | Almost always the base URL. The request never reaches the gateway, so nothing shows up in your usage history at all. |
| 524 timeout on long API requests | A long-running request hitting an edge timeout. Which endpoint you call decides whether this can happen to you. |
| Model not found — when the model name is almost right | Either the model string is misspelled, or your key belongs to a group that does not carry that model. |
| 429 from an API gateway means two different things | Two opposite causes share one status code: an empty balance never succeeds on retry, upstream congestion clears in seconds. The body tells you which. |
| CORS error calling an AI API from the browser | The CORS block is the symptom. The real problem is that a browser request hands your key to every visitor. |
| 400 when forcing a tool call on a reasoning model | Models that always reason refuse a forced tool call rather than silently skipping the reasoning. Same for non-default temperature. |
| Requests die at exactly 100 seconds behind Cloudflare | A long completion fails at almost exactly 100 seconds with a 524 or a dropped stream. The number is a Cloudflare proxy limit, not your server's. How t |
| The model returns an empty string but you are still billed | The response arrives with HTTP 200, content is an empty string, and the usage record shows output tokens were charged. On reasoning models this is alm |
| A streaming response stops in the middle of a sentence | Tokens arrive, then stop, and no error is raised. The difference between a completed stream and a severed one is a single line in the SSE body — and m |
| A model that worked yesterday now fails for everyone on the same key group | A model that has been working starts returning errors for every key in one group, while other groups are unaffected. This is routing, not the model: o |
| The bill is higher than the token count seems to justify | Your logged token totals look modest but the charge does not. On Claude-family models the usual cause is cache direction: a cache write costs more tha |
| Claude Code and Codex need different base URLs on the same gateway | The same gateway, the same key, two coding agents — and a base URL that works in one fails in the other. The rule is simple once you know which client |
| 405 Method Not Allowed when calling an AI API | A 405 on an AI endpoint almost never means the method is wrong. It means the POST landed somewhere that only serves pages — usually the bare domain, b |
| 404 on /responses — the Responses API needs the version prefix too | Clients moving from chat/completions to the Responses API often drop the version prefix. The 404 comes from the edge, before any API code runs, so the |
| context_length_exceeded — what actually counts toward the limit | The limit covers the whole conversation plus the space reserved for the answer, not just your last message. Why trimming the prompt often does not hel |
| 529 overloaded_error from Claude — what it is and what to do | 529 means the upstream is saturated right now. It is not a quota problem and not something your key can fix. How to tell it apart from 429, and the re |
| 401 with a key that is definitely correct — check the header format | A key can be perfectly valid and still produce 401 if the header is built wrong. The three ways it goes wrong, and how to see the header your client a |
| 400 unsupported parameter on a reasoning model | Reasoning models reject sampling parameters that every other model accepts. Which ones to remove, why the default is usually what you wanted anyway, a |
| Token usage missing from a streamed response | A streamed response carries no token counts unless you request them. How to turn them on, where the final chunk arrives, and what to do when a gateway |
| 400 on a tool call — every tool_use needs a matching tool_result | The error surfaces one turn later than the mistake, which is what makes it confusing. The pairing rule, the ordering rule, and how to reproduce it del |
| JSON mode still returns text that will not parse | response_format constrains the shape, not the finish. Truncation, missing schema enforcement and prose around the object each break parsing in a diffe |
| The call works in curl but not from your application | Same key, same URL, different result. The difference is almost always in something curl does not do: a proxy, a stale environment variable, an IP rest |
| SSL certificate verify failed when calling an AI API | A TLS failure from your SDK while curl works is almost always a corporate proxy or antivirus re-signing traffic. Why disabling verification is the wro |
| socket hang up in the middle of a streamed response | A stream that stops partway leaves you with a partial answer and no error from the model. How to tell a network drop from an upstream abort, and what |
| Claude Code: API Error 400 prompt is too long | The error names the request but the cause is accumulated session context: files read, tool output and conversation history all resend on every turn. W |
| Image input rejected by a vision model | Vision endpoints reject images for four distinct reasons that produce nearly identical errors. How to tell them apart before you start re-encoding. |
| The system prompt behaves differently across models | The two dominant API shapes place system instructions differently. Code written for one silently degrades on the other rather than failing, which is w |
| Reading a 429 properly — retry-after and the limit headers | Most retry code guesses. The response usually tells you exactly how long to wait and which limit you hit. How to read it, and what to do when the head |
| A custom endpoint's models do not appear in the client's list | Desktop clients build their model list in different ways, and several never call /v1/models at all. How to tell which kind you have and what to do in |
| Empty response with finish_reason content_filter | An empty completion with a content_filter finish reason means a safety system stopped it. How to tell that apart from truncation and from an actual fa |
| Usage log timestamps do not match when you made the call | A call that appears hours away from when you made it is almost always a timezone difference rather than a lost record. How to line the two up before r |
| Charged twice for what looked like one request | A client-side timeout does not stop work already running on the server. The usual shape of an accidental double charge, and the two changes that preve |
| Concurrency limit exceeded for user, please retry later | This 429 means too many requests from one account were open at the same moment — not too many per minute. Every key on the account shares the limit. W |
Before reading any individual page, check whether the failed request appears in your usage history at all. That single fact splits the problem in half:
/v1, or a typo in the
host. The 404 is returned at the edge, which is why it leaves no trace.People lose hours to the first case because a path mistake looks exactly like a bad key from the client side. Checking the log first turns a guess into a lookup.
https://apiclan.us/v1 for OpenAI-lineage clients and SDKs.
https://apiclan.us with no /v1 for Claude Code and the
Anthropic SDK, because those append /v1/messages themselves. Per-client
settings are in the base URL guide.
A key belongs to exactly one group, and a group carries one family of models. A key made for text models will be refused by image models even though the key itself is valid. If some models work and one does not, on the same key, that is a group boundary rather than an outage — make a second key. Which models sit in which group is on the price list.
Email support@apiclan.us with the model name, the base URL you configured, and whether the call shows up in your usage history. Those three facts identify almost every case immediately. General questions are answered on the FAQ.
No subscription, no monthly minimum, no sales call. Top up with USDT and spend what you use — 1 USDT gives you 2 credits of API balance.
Read the 30-second quickstartPrices quoted on this page are regenerated automatically from live billing data. Third-party terms are quoted from that party's own published documentation.