Skip to navigation

Create a response

Creates an OpenAI-compatible response through Respan. Choose the OpenAI, Azure, or Perplexity example and replace PROVIDER_API_KEY with that provider’s key. For Azure, also replace YOUR_AZURE_DEPLOYMENT and YOUR_RESOURCE. Provider credentials can instead be stored in Settings > Providers. Successful responses include X-Respan-Log-Id and are logged with the 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, such as perplexity/sonar, or send models instead.

streambooleanOptionalDefaults to false

Return Responses API server-sent events when true.

presetstringOptional

Perplexity Agent API preset, such as medium. Send it with model or models: a preset alone fails Respan’s model validation.

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. A response stored without cache_ttl is served from the cache for at most 30 minutes.

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
403
Forbidden Error
422
Unprocessable Entity Error