Base URL: pointing a client at the right API
A base URL is the root address of an API that a client library or app adds endpoint paths to when it sends requests.
What a base URL is
An endpoint like /chat/completions is only half an address. The base URL is the other half: the scheme, host and any path prefix that come before it. OpenAI's default is https://api.openai.com/v1. Any OpenAI-compatible client that lets you change the base URL can talk to a different provider using the same code.
For Wild West API the OpenAI-style base URL is:
https://wildwestapi.com/v1
Setting it in common clients
OpenAI Python SDK:
from openai import OpenAI client = OpenAI(base_url="https://wildwestapi.com/v1", api_key="sk-ww-...")
OpenAI JavaScript SDK: pass baseURL to the constructor, from server-side code only.
Anthropic SDKs add /v1/messages themselves, so they normally expect the host without /v1. Check the docs for the exact value.
SillyTavern: API Connections, Chat Completion, source Custom (OpenAI-compatible), and put https://wildwestapi.com/v1 in the custom endpoint field. See the SillyTavern guide.
How clients build the final URL
Most clients join the base URL and the path, so https://wildwestapi.com/v1 plus /chat/completions becomes https://wildwestapi.com/v1/chat/completions. That is why the base URL must not include the endpoint path itself.
The same base URL serves every request type the client knows how to make. A client that lists models calls /models on it, and a client that sends chat requests calls /chat/completions. If the model list fails to load in an app but chat requests work, type the model ID by hand: outlaw-1, glm-5.3-outlaw, glm-5.3-flash-outlaw, mimo-v2.6-flash-outlaw or qwen3.8-27b-outlaw.
Environment variables are a common way to set it without editing code. The OpenAI Python SDK, for example, reads OPENAI_BASE_URL and OPENAI_API_KEY if you do not pass them, which lets many existing tools be pointed at another provider with no code change.
Common mistakes
- Full endpoint as base URL.
https://wildwestapi.com/v1/chat/completionsas the base produces.../chat/completions/chat/completionsand a 404. - Missing /v1.
https://wildwestapi.comin an OpenAI client produces/chat/completionswithout the version prefix. - Double /v1. Some apps add
/v1themselves; giving them a base URL that also has it creates/v1/v1. - http instead of https, or a trailing space from pasting.
- Calling from a browser. The API does not answer CORS today, so a web page that calls it directly fails with a CORS error even when the URL is right. Use a backend, or a frontend with its own server such as SillyTavern.
When unsure, test with curl against the full endpoint first, then work backward to what your client wants.
FAQ
What is the Wild West API base URL?
https://wildwestapi.com/v1 for OpenAI-compatible clients. Anthropic SDKs add /v1/messages themselves, so check the docs for the value they expect.
Why do I get a 404 after setting the base URL?
The path is probably doubled or missing. Make sure the base URL ends at /v1 and does not include /chat/completions.