Gateway

Create a response

Changed on

Creates an OpenAI-compatible response through Respan. Choose the OpenAI, Azure, Perplexity, or Bedrock example. The OpenAI and Perplexity examples use Respan-managed routing when the model is available on credits; provider credentials can also be stored in Settings > Providers or supplied in respan_params.credential_override. For Azure, replace YOUR_AZURE_DEPLOYMENT, YOUR_RESOURCE and PROVIDER_API_KEY with your Azure deployment and credentials. Bedrock Responses requires your own AWS Bedrock credentials configured in Respan (BYOK); Respan credits are not supported for this route. Successful responses include X-Respan-Log-Id and are logged with the provider model and cost.

post/api/responses

Request

  • Base URL
    https://api.respan.ai
  • URL
    https://api.respan.ai/api/responses
  • Auth
    HTTP bearer

Query parameters

format'json' | 'txt'

Headers

X-Respan-Route-Provider'openai' | 'azure' | 'perplexity' | 'bedrock'

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

Request body

modelstring

OpenAI: use a supported model such as gpt-6-luna. Azure: use azure/<your-deployment-name>. Perplexity: use a provider-prefixed model, such as perplexity/sonar, or send models instead. Bedrock: use a bedrock-prefixed inference profile, such as bedrock/us.openai.gpt-6.1-sol.

streamboolean

Return Responses API server-sent events when true.

presetstring

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

modelsstring[]

Perplexity Agent API fallback model chain, tried in order.

max_stepsinteger

Maximum Perplexity agent steps.

language_preferencestring

Preferred response language for Perplexity Agent API.

response_formatobject

Perplexity Agent API structured response configuration.

cache_enabledboolean

Enable response caching for this request.

cache_ttlnumber

Cache lifetime in seconds. A response stored without cache_ttl is served from the cache for at most 30 minutes.

customer_identifierstring

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

Response

Response object or event stream from the selected Responses upstream.

object required

Changes

    • breaking

      request body became required

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • breaking

      the response property / became nullable for the status

    • info

      api operation id gateway_createResponse removed and replaced with createResponse

    • info

      api tag Gateway added

    • info

      api tag gateway removed

    • info

      the request optional property /// became write-only

    • info

      added the new enum value bedrock to the header request parameter X-Respan-Route-Provider

    • info

      the request property format was generalized from double to no format

    • info

      the / request property format was generalized from double to no format

    • info

      removed subschema #1 subschema #2 from the / response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the / response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the / response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the / response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the / response property oneOf list for the response status

    • info

      removed subschema #1 subschema #2 from the / response property oneOf list for the response status

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's body type changed from no type to object for status

    • info

      added the non-success response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status