{
  "id": 17936591,
  "title": "How Claude Code's ANTHROPIC_BASE_URL works, and how to check that a relay really serves Claude",
  "url": "https://urgent.news/2026/11/03/how-claude-codes-anthropic-base-url-works-and-how-to-check-that-a",
  "topic": "ai",
  "section": "AI",
  "published": "2026-11-03T08:51:25.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/corecode/how-claude-codes-anthropicbaseurl-works-and-how-to-check-that-a-relay-really-serves-claude-49j2"
  },
  "original_language": "en",
  "account": "The text above outlines how to verify whether a Claude Code relay is serving the Claude model correctly, and how to check if a relay is actually using Claude. The process involves examining environment variables, running checks against the relay, and analyzing the response behavior.\n\nFirstly, the ANTHROPIC_BASE_URL environment variable should be set to point to the API endpoint of the relay. This is followed by setting either ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY as headers for authentication. The relay can take precedence over a signed-in subscription, so ANTHROPIC_DEFAULT_OPUS_MODEL / SONNET / HAIKU variables may need to be adjusted accordingly.\n\nTo confirm that the relay is indeed serving Claude, one can run the `/status` command and check the Anthropic base URL line. If the login method displays a claude.ai account, the credential is likely being used correctly. When a cheaper plan swaps out the model, the relay should still respond as if it were serving Claude.\n\nNext, there are three specific checks that can be performed using Python scripts:\n\n1. The check-relay.py script verifies that the response is in Anthropic Messages format, includes a cache control header, and rejects modified signatures with a 400 error. While it doesn't specify the tier, it confirms that the upstream is Anthropic.\n2. ModelTrace estimates the model family and version by generating long integer sequences multiple times and comparing digit distributions to known model fingerprints.\n3. Comparing usage costs between two identical requests using the cache yourself can provide insight into whether caching is functioning properly and if usage is being charged correctly.\n\nLastly, it is important to review the price list for the relay service to understand how input, output, cache write, and cache read costs are billed separately, and to ensure that per-request usage and costs are visible in the log. Additionally, there should be a single account associated with each session for caching to work correctly.",
  "summary": "Before you put a cheap Claude Code relay (an API proxy) in front of your work, it is worth checking for yourself that Claude is the model answering. The first half of this post covers the environment variables Claude Code reads; the second half is a set of checks that work against any relay. I run a relay called CoreCode (disclosure at the end). 1. The environment variables Claude Code reads From…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 3,
    "also_reported_by": [
      {
        "outlet": "OpenAI",
        "title": "Qodo builds context into AI code review with Codex",
        "url": "https://urgent.news/2026/11/02/qodo-builds-context-into-ai-code-review-with-codex",
        "published": "2026-11-02T00:00:00.000Z"
      },
      {
        "outlet": "XDA Developers",
        "title": "I asked Claude Code, Codex, and Antigravity to build the same Android app, and only one made something I'd actually install",
        "url": "https://urgent.news/2026/11/02/i-asked-claude-code-codex-and-antigravity-to-build-the-same-android",
        "published": "2026-11-02T17:31:23.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}