APIs and setup
OpenAI-compatible API
An OpenAI-compatible API accepts requests and returns answers in the same format as OpenAI's API, so code written for OpenAI works with it after changing the base URL, the API key and the model ID.
Also called OpenAI API compatibility, OpenAI-compatible endpoint
Checked November 29, 2026
At a glance
- Format
- OpenAI's Chat Completions, and often its Responses API
- To switch
- Change the base URL, the key and the model ID
- Works with
- OpenAI's SDKs, and the tools and frameworks built on them
- Offered by
- Many makers and gateways; Anthropic's layer is meant for testing
- On /model
https://api.slashmodel.com/v1with the OpenAI SDKs
OpenAI's request shapes, Chat Completions above all, became the common format for AI APIs. Most coding tools, frameworks and SDKs can talk to any server that speaks it, so a maker or a gateway that accepts it works with all of them, with no plugin of its own.
Model makers do this too. Anthropic has an OpenAI SDK compatibility layer for Claude at https://api.anthropic.com/v1/, meant mainly for testing and comparing models; for the full feature set, such as prompt caching and thinking, it points to its own API (Anthropic). DeepSeek says its API format is compatible with OpenAI's and Anthropic's (DeepSeek).
What changes, and what doesn't
- Changes: the base URL, the API key and the model ID.
- Stays the same: the SDK, the request and response shapes, streaming, and usually tool calls and JSON output.
- Check: the parameters you rely on. A compatible API may not support all of OpenAI's, and servers differ on the less common ones.
OpenAI compatibility on /model
/model takes OpenAI's Chat Completions at /v1/chat/completions and its Responses API at /v1/responses, and embeddings and image generation in the OpenAI format too. Set the OpenAI SDK's base_url to https://api.slashmodel.com/v1 and api_key to your key; the rest of your code stays the same (OpenAI SDK).
import os
from openai import OpenAI
client = OpenAI(
base_url="https://api.slashmodel.com/v1",
api_key=os.environ["SLASHMODEL_API_KEY"],
)
response = client.chat.completions.create(
model="gpt-6.1-sol",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)A parameter it doesn't support, such as logprobs or audio input, gets a 400 unsupported_parameter, with the parameter's name in param (Errors).
Where it applies on /model
Questions
Can I use Claude through an OpenAI-compatible API?
Yes. Anthropic's own compatibility layer is meant for testing, and Anthropic points to its native API for the full feature set. On /model, Claude models answer on /v1/chat/completions in the OpenAI format and on /v1/messages in Anthropic's.
Does every OpenAI parameter work on a compatible API?
Not always. Servers differ on the less common parameters. Check the server's docs, and read the error: a good one names the parameter it refused.
Sources
The makers' own pages, each opened on November 29, 2026.