Create a response

Create an OpenAI-compatible response through Respan. Enter RESPAN_API_KEY in the Authorization control, choose the openai, azure, or perplexity example, and replace PROVIDER_API_KEY with that provider's key. Each example owns its fixed route-provider header and compatible request shape. The OpenAI example is otherwise ready to run. For Azure, also replace YOUR_AZURE_DEPLOYMENT and YOUR_RESOURCE; a Responses-compatible api_version is prefilled. Switching examples clears provider-specific fields left by the previous selection. Provider credentials may alternatively be stored in Settings -> Providers. Successful responses include X-Respan-Log-Id and are logged with the actual provider model and cost.

Authentication

AuthorizationBearer

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer <RESPAN_API_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan_params.credential_override in the request body, not in this authentication field.

Headers

X-Respan-Route-ProviderenumOptional

Responses upstream. Each named API Explorer example prepopulates its matching value; keep the header paired with the selected example. The Perplexity opt-in is header-only, case-insensitive, and whitespace-tolerant.

Allowed values:

Query parameters

formatenumOptional
Allowed values:

Request

OpenAI Responses API request. Standard Responses fields are accepted. Perplexity extensions are accepted only when X-Respan-Route-Provider is perplexity. Respan cache controls and customer_identifier may be sent at the request root or under respan_params; nested values win when both are present.

inputstring or list of anyRequired
Text or structured input for the response.
modelstringOptional

OpenAI: use a supported model such as gpt-4o-mini. Azure: use azure/<your-deployment-name>. Perplexity: use a provider-prefixed model, or omit model when using preset or models.

streambooleanOptionalDefaults to false

Return Responses API server-sent events when true.

presetstringOptional
Perplexity Agent API preset. May be used without model.
modelslist of stringsOptional
Perplexity Agent API fallback model chain, tried in order.
max_stepsintegerOptional>=1
Maximum Perplexity agent steps.
language_preferencestringOptional
Preferred response language for Perplexity Agent API.
response_formatobjectOptional
Perplexity Agent API structured response configuration.
skillslist of anyOptional
Perplexity Agent API skills.
toolslist of anyOptional

Response tools. Perplexity supports web_search with filters such as search_domain_filter.

respan_paramsobjectOptional

Respan metadata, prompt configuration, customer identifiers, provider credentials, and other gateway parameters. route_provider_override here cannot activate the Perplexity route.

cache_enabledbooleanOptional
Enable response caching for this request.
cache_ttldoubleOptional
Cache lifetime in seconds.
cache_optionsobjectOptional
customer_identifierstringOptional

End-customer identifier used for logging and optional cache partitioning.

Response headers

X-Respan-Log-IdstringOptional
Unique ID of the Respan request log.

Response

Response object or event stream from the selected Responses upstream.

Errors

400
Bad Request Error
401
Unauthorized Error
422
Unprocessable Entity Error