Wild West API

Use Claude Code with an uncensored LLM API

Claude Code can be pointed at any gateway that serves the Anthropic Messages format, and Wild West serves it at /v1/messages. Read the limitation section first: Anthropic does not support this use.

Set it up

  1. Sign in at wildwestapi.com/signup/ with the six-digit code sent to your email, open the dashboard and create an API key. It starts with sk-ww- and is shown in full once, so copy it somewhere safe.
  2. Set ANTHROPIC_BASE_URL to https://wildwestapi.com, with no /v1 on the end.
  3. Set ANTHROPIC_AUTH_TOKEN to your sk-ww- key.
  4. Set ANTHROPIC_MODEL to outlaw-1 and ANTHROPIC_DEFAULT_HAIKU_MODEL to outlaw-1, so background tasks do not ask for a Claude model.
  5. Start claude, run /status to see the base URL and credential in use, and send a short test message.

Shell setup

Claude Code's gateway guide builds its test request as $ANTHROPIC_BASE_URL/v1/messages, so the base URL excludes /v1. The ANTHROPIC_AUTH_TOKEN variable sends the credential as an Authorization: Bearer header; ANTHROPIC_API_KEY sends it as x-api-key.

# Bash or Zsh
export ANTHROPIC_BASE_URL=https://wildwestapi.com
export ANTHROPIC_AUTH_TOKEN="$WILDWEST_API_KEY"
export ANTHROPIC_MODEL=outlaw-1
export ANTHROPIC_DEFAULT_HAIKU_MODEL=outlaw-1
claude

# PowerShell
$env:ANTHROPIC_BASE_URL = "https://wildwestapi.com"
$env:ANTHROPIC_AUTH_TOKEN = $env:WILDWEST_API_KEY
$env:ANTHROPIC_MODEL = "outlaw-1"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL = "outlaw-1"
claude

To make it permanent, put the same names in the env block of ~/.claude/settings.json. Keep the key out of any settings file that is committed to a repo.

Variables that may help

  • CLAUDE_CODE_MAX_CONTEXT_TOKENS sets the window Claude Code assumes for an id it does not recognise. Otherwise it assumes 200K.
  • CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 stops it sending pre-release fields, and is the documented fix for 400 errors such as Extra inputs are not permitted.
  • If you get a 401, try ANTHROPIC_API_KEY in place of the token variable.

One limit to know

Anthropic's gateway page says it does not support routing Claude Code to non-Claude models through any gateway. Claude Code is tuned for Claude: it sends beta headers, adaptive reasoning fields and tool shapes built for those models, and a gateway has to cope with all of them. Expect rough edges, such as a 400 from an unfamiliar field. If you want a tool built for this job, Aider, opencode and Cline are friendlier. Remote Control also stops working once a non-Anthropic base URL is set.

FAQ

Is this an official way to use Claude Code?

No. Anthropic documents gateways for Claude models and says routing Claude Code to non-Claude models is not supported. Treat it as an experiment.

Will my Claude subscription still be used?

No. While a gateway credential variable is set, requests carry that credential instead of your claude.ai login, and the subscription limits do not apply to them. Unset the variables to go back.

Related

Uncensored AI models on one key

OpenAI and Anthropic compatible, pay as you go. New to it? Start with uncensored AI, explained.