Wild West API

Use the Anthropic Python SDK with an uncensored LLM API

Wild West also answers in the Anthropic Messages format at /v1/messages. The anthropic package can talk to it if you override the base URL, which is useful when your code already uses Anthropic message and tool shapes.

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. Install with pip install anthropic.
  3. Export the key as WILDWEST_API_KEY.
  4. Create Anthropic with base_url set to https://wildwestapi.com, with no /v1 on the end.
  5. Call client.messages.create with model outlaw-1 and a max_tokens value.

Why the base URL has no /v1

The SDK adds the version path itself. Its client source defaults base_url to https://api.anthropic.com and requests go to /v1/messages under it. Anthropic's own gateway guide builds the test URL as $ANTHROPIC_BASE_URL/v1/messages too. So give it https://wildwestapi.com. If you put /v1 on the end you will probably hit /v1/v1/messages and get a 404.

A working call

import os
from anthropic import Anthropic

client = Anthropic(
    base_url="https://wildwestapi.com",
    api_key=os.environ["WILDWEST_API_KEY"],
)

msg = client.messages.create(
    model="outlaw-1",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Write the opening of a noir story."}],
)
print(msg.content[0].text)

max_tokens is required by the Messages format, unlike Chat Completions. The SDK also reads ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY from the environment if you prefer not to pass arguments.

Auth header and streaming

api_key is sent as the X-Api-Key header. The SDK also has an auth_token argument that sends Authorization: Bearer instead. Try api_key first, and switch to auth_token if you get a 401. For streaming, use the client.messages.stream(...) context manager and read stream.text_stream. Tool use follows the Messages tools shape.

One limit to know

Only the Messages endpoint is on offer. Other parts of the Anthropic API, such as batches or files, are not documented for this gateway, and the model ids are Wild West ids, not Claude ids. If your code hard-codes a Claude model name, change it.

FAQ

Should I use the OpenAI SDK instead?

If you are starting fresh, the OpenAI format is the more common choice and has more tooling around it. Use the Anthropic format when your code already depends on it.

Which header does Wild West read for the key?

The SDK can send either x-api-key or a bearer token. Use api_key first; if that returns 401, pass the same key as auth_token.

Related

Uncensored AI models on one key

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