Python
If you're using the OpenAI Python SDK, change two lines: set base_url to your SAPI endpoint and use your SAPI API key instead of your OpenAI key.
from openai import OpenAI client = OpenAI(base_url="https://your-sapi-host/v1", api_key="sk-sapi-...")
Node.js
The OpenAI Node.js SDK supports the same pattern. Pass baseURL and apiKey in the constructor — no other code changes required.
const openai = new OpenAI({ baseURL: 'https://your-sapi-host/v1', apiKey: process.env.SAPI_API_KEY });
cURL
For direct HTTP calls, replace the OpenAI URL with your SAPI endpoint and swap the Authorization header to use your SAPI key.
curl https://your-sapi-host/v1/chat/completions -H "Authorization: Bearer sk-sapi-..." -H "Content-Type: application/json" -d '{"model":"gpt-4o","messages":[{"role":"user","content":"Hello"}]}'
See our Quickstart guide and SDK documentation for complete examples.