Disclosure: independent site. Links to AgentRouter are referral links — we may earn a reward if you sign up, at no extra cost to you. We do not publish pricing or promo numbers we have not verified.

The endpoint died. It usually was going to.

Free and community-run API endpoints fail in patterns, not at random. Gateway timeouts, upstreams that vanish, model catalogs that shrink overnight, keys that stop working between one session and the next. None of that is your configuration's fault — but telling provider death from your own misconfiguration takes about sixty seconds if you know the three checks.

First: is it them or you

Your agent will retry, wrap the error, and show you something unhelpful like 'request failed'. Cut through all of it with one direct request to the endpoint. If curl fails the same way the agent does, the problem is upstream and no amount of config editing will fix it.

  1. List the models the endpoint currently serves: curl -s "$ANTHROPIC_BASE_URL/v1/models". An empty list, a 404, or a timeout here is the provider, not you.
  2. Send one real completion request with curl against the same model your agent uses. Compare the HTTP status: 503/504 means upstream dead or overloaded; 401 means your key or quota; 404 naming a model means the catalog changed.
  3. Check the provider's own status page or community channel for an outage note. Free providers rarely post one — absence of news after repeated 503s usually is the news.
What this rules out
  • If the model list works but completions fail, your base URL and auth are fine — stop editing them.
  • If curl works but the agent fails, the problem is client-side: precedence, path doubling, or model validation. Those are covered on our custom-endpoint and 401 pages, not here.
  • A single failed request means nothing. Free upstreams hiccup. The pattern (every request, for hours) is the signal.

The lifecycle of a free endpoint

Free endpoints are usually thin fronts over someone else's paid capacity: trial credits, promo quotas, or resold accounts. When the credits run out or the upstream rotates, the front keeps standing — it just starts returning 503s, or quietly drops models from /v1/models, or lets streams start and then die mid-generation when a quota trips partway through.

This is why free-endpoint failures feel personal but aren't: the same Tuesday, hundreds of people hit the identical wall. The practical response is not to find a magically stable free endpoint (they exist until they don't) but to make switching endpoints cheap enough that a dead one costs you minutes, not an evening.

Make your setup survivable

  1. Keep a second, paid-or-broader endpoint configured before you need it — registration takes minutes, and a working fallback beats an emergency signup mid-task.
  2. Use the alias slots (ANTHROPIC_DEFAULT_SONNET_MODEL and friends) so switching providers is one environment change, not a config rebuild. See our custom-endpoint page for the exact variables.
  3. Before switching your agent, curl the new endpoint's /v1/models and one completion. Thirty seconds of verification prevents the classic 'switched and now it 401s' spiral.
  4. Note which API surface each of your tools uses — Anthropic-style (/v1/messages) or OpenAI-style (/v1/chat/completions). A fallback must serve the same surface or the switch silently breaks.
What you seeWhat it usually meansNext move
504 gateway timeout, every requestUpstream dead or overloadedConfirm with curl, then switch endpoints — this one is done for now
SSE stream starts then dies mid-answerQuota or credit cutoff partway through generationRetry once; if it repeats, the free tier is throttling you
401 after working fine yesterdayKey revoked or quota exhaustedCheck the provider console for quota/billing state before touching config
404 on a model that worked last weekProvider removed it from the catalogRe-list /v1/models and pick from what actually exists
Everything works from your phone's hotspot but not your networkLocal blocklist, VPN, or DNSNot the provider — check your network path

When the free endpoint dies, have a real one configured

AgentRouter is an Anthropic-compatible router with per-token pricing and setup docs for 15 tools — Claude Code, Codex, Cline, Aider, OpenCode and more. Keeping it configured as your fallback turns a dead free endpoint into a one-line switch instead of a rebuild. Same surface, same variable names, documented model list.

Set up your fallback endpoint →

Referral link — we may earn a reward if you sign up, at no extra cost to you. This is the same advice we would give with no link at all. Check their current pricing and model list on their own site; we deliberately do not restate numbers that change.

Related

Error not on this page?

The Setup Doctor walks through your tool, symptom, and setup and points at the likely cause — no account needed.

Diagnose my error →