Any OpenAI-compatible client
Point any OpenAI-compatible client at OP Inference.
Most tools that talk to OpenAI accept a different base URL. Set three things:
| Setting | Value |
|---|---|
| Base URL | https://api.opinference.com/v1 |
| API key | Your OP Inference key |
| Model | A model id from /models, including its maker, such as openai/gpt-oss-120b |
Many clients, including the OpenAI SDKs, read the base URL and key from the environment:
export OPENAI_BASE_URL="https://api.opinference.com/v1"
export OPENAI_API_KEY="$OP_API_KEY"
python3 -c 'from openai import OpenAI; print(OpenAI().chat.completions.create(model="openai/gpt-oss-120b", messages=[{"role": "user", "content": "Say hello."}]).choices[0].message.content)'What a client must use
- Chat completions at
/v1/chat/completions, streaming or not. A client that only speaks the Responses API (/v1/responses) or the Anthropic Messages API (/v1/messages) does not work. - Model ids with their maker prefix.
gpt-oss-120balone is404 no_endpoint_available. GET /v1/modelsif the client lists models. It returns the models your key can use.
See Not supported for the rest.