Send a response request through the Respan gateway using the OpenAI Responses API format. Supports streaming, tool use, and prompt management.
Respan-specific parameters can be passed three ways:
1. **Top-level body fields** - add directly to the request body
2. **Nested under `respan_params`** - explicit namespacing to avoid conflicts
3. **Header `X-Data-Respan-Params`** - base64-encoded JSON header
Merge order: top-level body fields > `respan_params` > header.
Legacy compatibility:
- `keywordsai_params` is still accepted and merged into `respan_params`
- `X-Data-Keywordsai-Params` is still accepted and auto-renamed internally
Request
This endpoint expects an object.
modelstringRequired
Model to use.
inputstring or list of objectsRequired
Input text or array of conversation messages.
instructionsstringOptional
System instructions for the model.
streambooleanOptional
Stream the response as server-sent events.
temperaturedoubleOptional
Sampling temperature (0-2).
max_output_tokensintegerOptional
Maximum tokens to generate.
top_pdoubleOptional
Nucleus sampling parameter.
toolslist of objectsOptional
Tools the model may call.
previous_response_idstringOptional
ID of a previous response for multi-turn conversations.
fallback_modelslist of stringsOptional
Backup models if the primary model fails.
customer_credentialsobjectOptional
Per-customer LLM provider credentials.
credential_overrideobjectOptional
One-off credential overrides per provider.
cache_enabledbooleanOptional
Enable response caching.
cache_ttlintegerOptional
Cache TTL in seconds.
promptobjectOptional
Prompt template config. Properties: prompt_id (required), variables, version, echo. See Prompt management.
retry_paramsobjectOptional
Retry config. Properties: retry_enabled (boolean), num_retries, retry_after (seconds).
disable_logbooleanOptional
When true, omits input/output from the log. Metrics still recorded.
modelslist of stringsOptional
Model list for LLM router selection.
exclude_providerslist of stringsOptional
Providers to exclude from routing.
exclude_modelslist of stringsOptional
Models to exclude from routing.
metadataobjectOptional
Custom key-value metadata attached to the span.
custom_identifierstringOptional
Indexed custom tag for fast querying.
customer_identifierstringOptional
End user identifier for analytics and budgets.
customer_paramsobjectOptional
Extended customer info. Properties: customer_identifier (required), group_identifier, name, email, period_budget, budget_duration (daily/weekly/monthly), total_budget, markup_percentage.
thread_identifierstringOptional
Conversation thread ID.
positive_feedbackbooleanOptional
User feedback. true = liked, false = disliked.
propertiesobjectOptional
Typed metadata preserving native types.
respan_paramsobjectOptional
Namespaced container for all Respan parameters.