OpenAI-compatible APIs explained
An OpenAI-compatible API is a service that accepts requests and returns responses in the same format as OpenAI's API, so tools built for OpenAI can use it with only a URL and key change.
What it means
OpenAI's chat completions format became the common language for LLM APIs. A provider that speaks it lets you reuse the official OpenAI SDKs, SillyTavern's Custom (OpenAI-compatible) source, coding tools, agent frameworks and plain curl scripts. You change the base URL, the API key and the model ID, and the rest of the code stays the same.
What usually carries over
POST /v1/chat/completionswith amessagesarray and roles.- Standard parameters:
temperature,top_p,max_tokens,stop,presence_penalty,frequency_penalty,logit_bias,stream. - Streaming as server-sent events ending with
[DONE]. - Tool calling with
toolsandtool_calls. - Image input as
image_urlcontent parts on vision models. - A
usageobject with token counts.
What often differs
- Model IDs. Each provider has its own names.
- Extra samplers. Fields such as
min_p,top_korrepetition_penaltyare not in the OpenAI spec. Some providers accept them, some ignore them silently. - Newer OpenAI-only features such as the Responses API, built-in tools, or some structured output options may not exist.
- Error formats and limits differ in detail.
- Reasoning output. Providers return thinking text in different fields, if at all.
"Compatible" means the core works; edge features need testing.
Testing a provider
Before wiring a new provider into a larger app, send one request by hand. If curl works and your app does not, the problem is in the app's settings (usually the base URL, the key field, or a model ID the app filled in automatically), not the API. Then test the features you rely on one at a time: streaming, a tool call, an image, a stop sequence.
Also read the response. The model field confirms which model answered, finish_reason tells you whether the reply ended naturally, hit max_tokens, or stopped for a tool call, and usage gives the token counts you are billed for.
curl https://wildwestapi.com/v1/chat/completions \
-H "Authorization: Bearer sk-ww-..." \
-H "Content-Type: application/json" \
-d '{"model": "outlaw-1",
"messages": [{"role": "user", "content": "Write a two-line western opening."}],
"temperature": 0.9, "max_tokens": 200}'Wild West API compatibility
Wild West API serves an OpenAI-compatible /v1/chat/completions endpoint and an Anthropic-compatible /v1/messages endpoint at https://wildwestapi.com/v1, with keys starting sk-ww-. Models are outlaw-1, glm-5.3-outlaw, glm-5.3-flash-outlaw, mimo-v2.6-flash-outlaw and qwen3.8-27b-outlaw, all with tool calling. One limit to know: the API does not answer CORS today, so apps that run entirely in the browser cannot call it. Server-side code and SillyTavern work. Details are in the docs.
FAQ
Can I use the official OpenAI SDK with another provider?
Yes, if the provider is OpenAI-compatible. Set the base URL and API key in the client constructor and use that provider's model IDs.
Will every OpenAI parameter work?
The standard chat completions parameters usually do. Newer OpenAI-only features and non-standard samplers may be unsupported or ignored.