Skip to content

Anthropic-Compatible Endpoints: Run Claude Code on Any Backend

Run Claude Code on any backend using Anthropic-compatible endpoints. How ANTHROPIC_BASE_URL works, which providers support it, and setup on Windows — no proxy.

MGMCSA Guru Team June 15, 2026 4 min read
Claude Code environment variables pointing to an Anthropic-compatible endpoint on Windows

The simplest way to run Claude Code on a cheaper model needs no extra software at all. Claude Code reads a base-URL and a token from the environment, so if your provider exposes an Anthropic-compatible endpoint, you just point Claude Code at it and go. No proxy, no router, no translation layer.

This explains how that works, which providers support it, and exactly how to set it up on Windows and WSL. It’s the method to prefer whenever it’s available — see the overview in use cheap AI models with Claude Code.

What “Anthropic-compatible” means

Claude Code communicates using Anthropic’s Messages API format. An Anthropic-compatible endpoint is any server that accepts that exact format and replies in kind. Because the shapes match, Claude Code can’t tell the difference — it sends the same requests it always would, just to a different address.

That’s the whole trick. Several Chinese providers ship these endpoints specifically so tools like Claude Code work out of the box.

The setup

Three environment variables do it. For DeepSeek:

export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="sk-your-deepseek-key"
export ANTHROPIC_MODEL="deepseek-chat"
claude

That’s it — Claude Code now runs on DeepSeek. The ANTHROPIC_MODEL value sets which model to use; some providers also use a small/fast model variable for lightweight calls.

Which providers support it

Anthropic-compatible base URLs (confirm on provider docs)

DeepSeek https://api.deepseek.com/anthropic
Z.AI (GLM) https://api.z.ai/api/anthropic
Moonshot (Kimi) https://api.moonshot.ai/anthropic

These are the well-known ones; more providers add them over time. Always verify the current base URL and model IDs in the provider’s own Claude Code guide, since they change with new releases. Per-model walkthroughs: DeepSeek, GLM-5, Kimi.

Setting variables on Windows vs WSL

WSL (recommended): add them to your shell profile so they persist:

echo 'export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"' >> ~/.bashrc
echo 'export ANTHROPIC_AUTH_TOKEN="sk-your-key"' >> ~/.bashrc
echo 'export ANTHROPIC_MODEL="deepseek-chat"' >> ~/.bashrc
source ~/.bashrc

Native Windows (PowerShell): set them for the session, or use setx to persist:

$env:ANTHROPIC_BASE_URL = "https://api.deepseek.com/anthropic"
$env:ANTHROPIC_AUTH_TOKEN = "sk-your-key"
$env:ANTHROPIC_MODEL = "deepseek-chat"
claude

Endpoint vs router: when to use which

Anthropic endpoint vs Claude Code Router

Anthropic endpoint No proxy, fewer parts; needs provider support
Claude Code Router Works with OpenAI-only providers; adds per-task routing

Use the Anthropic endpoint when your provider offers one and you want one model. Use Claude Code Router when the provider is OpenAI-only, or when you want to route background, thinking, and long-context tasks to different models.

Verify

Start Claude Code and run a trivial task — list files, summarize the README. If it responds and edits normally, the endpoint is live. If you get auth errors, the token variable isn’t set in the current shell; if you get format errors, you’re probably on the OpenAI URL instead of the Anthropic one.

Anthropic endpoint checklist

  • Confirm the provider's Anthropic-compatible base URL
  • Set ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_MODEL
  • Use the /anthropic endpoint, not the /v1 one
  • Persist the vars in ~/.bashrc (WSL) or via setx (Windows)
  • Test on a small task; unset to return to Claude

Wrapping up

When a provider offers an Anthropic-compatible endpoint, running Claude Code on it is the cleanest path there is: set ANTHROPIC_BASE_URL, ANTHROPIC_AUTH_TOKEN, and ANTHROPIC_MODEL, and launch. No proxy, nothing to maintain. DeepSeek, GLM, and Kimi all support it; just be sure you’re using the /anthropic URL and not the OpenAI one.

When your provider is OpenAI-only or you want smart routing, reach for Claude Code Router. Either way, the model decision is covered in cheapest AI coding API in 2026.

Frequently asked questions

What is an Anthropic-compatible endpoint?

It's an API that speaks the same request and response format as Anthropic's Messages API. Because Claude Code talks that format, any such endpoint can serve it directly — you just change ANTHROPIC_BASE_URL and the auth token, no proxy needed.

Which providers offer one?

DeepSeek, Z.AI (GLM), and Moonshot (Kimi) all expose Anthropic-compatible endpoints, among others. Always check the provider's docs for the exact base URL, since it differs from their OpenAI-compatible endpoint.

What's the difference from Claude Code Router?

The router is a proxy that translates OpenAI-format APIs and adds per-task routing. An Anthropic-compatible endpoint needs no translation and no proxy — fewer moving parts, but no built-in routing. Use the endpoint when available; use the router for OpenAI-only providers or routing.

Do I set the model too?

Usually yes. Besides ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, providers often have you set ANTHROPIC_MODEL (and sometimes a small/fast model variable) to their model IDs. Check the provider's Claude Code guide.

Is this officially supported by Anthropic?

Pointing Claude Code at a third-party endpoint is a configuration the providers document, not an Anthropic-blessed integration. It works because of the compatible format, but support comes from the provider, not Anthropic.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.