DEV Community

江流石
江流石

Posted on

Debugging a relay API in Claude Code / Codex: 401 vs 404 vs 429

When you point Claude Code or Codex at a third-party relay and it errors, read the status code first — it tells you exactly what's wrong:

  • 404 — wrong address. Usually the /v1 on base_url: Anthropic-compatible endpoints have no /v1 (Claude Code appends /v1/messages); OpenAI-compatible endpoints need /v1.
  • 401 / 403 — auth failed. Key copied in full? Credit left? Model id in the station's list? Claude Code must use ANTHROPIC_AUTH_TOKEN (Bearer), not ANTHROPIC_API_KEY.
  • 429 — the station is rate-limiting. Switch stations or wait; retrying just lengthens the queue.
  • 400 / content blocked — upstream moderation. Retry in plain English/Chinese; if it keeps firing, switch stations.

Keep a couple of stations registered so a single one rate-limiting never blocks you. List with tested dates: AI relay station list

Signup links carry my referral param; strip ?aff= if you prefer.

Top comments (0)