OpenAI SDK (gateway)
OpenAI SDK (gateway)
Route OpenAI SDK calls through the Respan gateway to use 250+ models from different providers. Only your RESPAN_API_KEY is needed — no separate provider keys required.
Setup
Switch models
Change the model parameter to use 250+ models from different providers through the same gateway.
See the full model list.
Prompt management
Use Respan prompt management to serve prompt templates from the platform. Use schema_version: 2 for all new integrations.
Chat Completions
Prompt messages are the base layer (system/context). Body messages are appended as runtime user turns.
Responses API
Without a route header, /api/responses uses the default OpenAI route and requires an OpenAI provider credential. You can instead route the same OpenAI-shaped request to Azure OpenAI or Perplexity Agent API with X-Respan-Route-Provider.
For the Responses API, pass prompt config under respan_params. The prompt template becomes instructions and body input is preserved.
For Perplexity Agent API, set X-Respan-Route-Provider: perplexity in extra_headers. The opt-in is header-only; putting route_provider_override: perplexity in respan_params does not activate it. See the Responses API guide.
Respan parameters
Pass additional Respan parameters via extra_body for gateway features.
See Respan params & metadata for the full list.