Anthropic Python SDK with Wild West API
The Anthropic Python SDK posts to /v1/messages under a configurable base URL. Point it at Wild West API and pass your key as the bearer auth token.
- Base URL
- https://wildwestapi.com
- API key
- Get one free, starts sk-ww-
- Example model
- outlaw-1-xploded
base_url and auth_token
The SDK default base URL is https://api.anthropic.com and it appends /v1/messages, so set base_url to https://wildwestapi.com with no path. Pass the key as auth_token (sent as Authorization: Bearer), not api_key.
Python
# pip install anthropic from anthropic import Anthropic client = Anthropic( base_url="https://wildwestapi.com", auth_token="sk-ww-...", ) msg = client.messages.create( model="outlaw-1-xploded", max_tokens=1024, messages=[{"role": "user", "content": "Hello"}], ) print(msg.content[0].text)
One endpoint gap messages.count_tokens calls /v1/messages/count_tokens, which Wild West API does not implement. Avoid that helper; ordinary messages.create works.