OpenAI Python SDK with Wild West
Wild West speaks the OpenAI chat-completions dialect, so the official openai Python client works with a base URL change and nothing else.
- Base URL
- https://wildwestapi.com/v1
- API key
- Get one, starts sk-ww-
- Example model
- glm-5.3-outlaw
base_url and api_key
Set base_url to https://wildwestapi.com/v1 (the /v1 is part of it) and api_key to your key. The client also reads OPENAI_BASE_URL and OPENAI_API_KEY from the environment.
Python
# pip install openai from openai import OpenAI client = OpenAI( base_url="https://wildwestapi.com/v1", api_key="sk-ww-...", ) resp = client.chat.completions.create( model="glm-5.3-outlaw", messages=[{"role": "user", "content": "Hello"}], ) print(resp.choices[0].message.content)
Use chat completions Wild West serves /v1/chat/completions, /v1/responses and /v1/models. It has no /v1/completions or /v1/embeddings, and this guide uses the chat.completions call.