# Anthropic base URL not working

> ANTHROPIC_BASE_URL ignored or returning 404 in Claude Code? Use the bare host, remove ANTHROPIC_API_KEY and log out. Step-by-step fix.

When ANTHROPIC_BASE_URL seems ignored, Claude Code is usually still signed in to an Anthropic account, the URL has an extra path, or ANTHROPIC_API_KEY is set next to ANTHROPIC_AUTH_TOKEN. For Outrun the base URL is exactly https://api.outrun.to, with no /v1. Run /logout, open a new terminal and check /status.

## What causes it?

- Claude Code is still using a saved Anthropic login.
- The URL ends in /v1 or /v1/messages, so requests go to the wrong path and return 404.
- ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN are both set, which causes an authentication conflict.
- The variable was set in a terminal that Claude Code was not started from.

## How do I fix it?

In this order. [The Claude Code setup guide](https://outrun.to/docs/setup/claude) has the full setup.

- Set ANTHROPIC_BASE_URL to https://api.outrun.to (bare host, no /v1).
- Put your Outrun key in ANTHROPIC_AUTH_TOKEN and remove ANTHROPIC_API_KEY from your environment and from ~/.claude/settings.json.
- Close every terminal and VS Code window, open a new terminal and run claude.
- Run /logout if Claude Code still uses your Anthropic account, then accept the custom API key.
- Run /status: it shows the base URL in use.

**~/.claude/settings.json**

```
{
 "env": {
 "ANTHROPIC_BASE_URL": "https://api.outrun.to",
 "ANTHROPIC_AUTH_TOKEN": "KEY",
 "ANTHROPIC_MODEL": "claude-sonnet-5-5"
 }
}
```

## Questions

### Does ANTHROPIC_BASE_URL need /v1?

Not for Outrun. Claude Code adds /v1/messages itself, so the base URL is the bare host https://api.outrun.to.

### How do I check which base URL Claude Code uses?

Run /status inside Claude Code. It shows the base URL and the current model.

### Does Outrun keep my prompts or outputs?

Outrun does not store your prompts, images or outputs unless you choose to save them.

## Related pages

- [Claude Code 429 Too Many Requests](https://outrun.to/fix/claude-code-429-too-many-requests)
- [Claude Code usage limit reached](https://outrun.to/fix/claude-code-usage-limit-reached)
- [Claude Code setup guide](https://outrun.to/docs/setup/claude)
- [All error fixes](https://outrun.to/fix)
- [Get your API key](https://outrun.to/overview)

[Get your API key](https://outrun.to/key) [See all models and prices](https://outrun.to/pricing)
