Skip to main content
POST
Create a response (OpenAI Responses protocol)

Authorizations

Authorization
string
header
required

Send your SLNG API key as a Bearer token (an OpenAI SDK's api_key option). Provider credentials in slng_config authenticate to those providers.

Headers

X-Slng-Agent-Id
string

Stable agent ID. Scopes the cache β€” change it when the system prompt changes. Required unless sent as slng_agent_id (body wins). Max 256 chars; no whitespace, commas, pipes or braces.

Opaque ID. Max 256 characters; no whitespace, commas, pipes or braces.

Maximum string length: 256
Pattern: ^[^\s,|{}]+$
X-Slng-Session-Id
string

ID for a single call, constant across its turns. Required unless sent as slng_session_id (body wins). Same character rules as the agent ID.

Opaque ID. Max 256 characters; no whitespace, commas, pipes or braces.

Maximum string length: 256
Pattern: ^[^\s,|{}]+$
X-Slng-Request-Id
string

Optional correlation ID, echoed back in x-slng-request-id. X-Request-Id is also accepted.

Body

application/json

OpenAI Responses body (input and instructions), plus the same SLNG extensions as Chat Completions.

model
string
default:slng/auto
input

Responses-protocol input.

instructions
string
stream
boolean
template_variables
object

SLNG extension. {name: value} map substituted into {{name}} placeholders in the system message only. Names are letters, digits and underscore.

Limits (over any returns 422): 64 variables, 64-char names, 4000-char values. A {{name}} with no value returns 422 (missing_template_variables); unused variables are ignored.

Use for personalization that is spoken or echoed. Values that steer the answer (language, plan, region) belong in the prompt β€” steering here can make the cache serve another caller's answer.

Example:
slng_config
object

SLNG extension. Model endpoints and provider keys sent inline, replacing your saved configuration for that request. Treat as a credential (HTTPS, keep out of logs); under 256 KB serialized. Invalid config returns 400 (invalid slng_config:); a non-object returns 422 (invalid_slng_config).

slng_agent_id
string

Opaque ID. Max 256 characters; no whitespace, commas, pipes or braces.

Maximum string length: 256
Pattern: ^[^\s,|{}]+$
slng_session_id
string

Opaque ID. Max 256 characters; no whitespace, commas, pipes or braces.

Maximum string length: 256
Pattern: ^[^\s,|{}]+$
slng_analytics
boolean
default:false
slng_pure_proxy
boolean
default:false

Response

A Responses-protocol envelope.

OpenAI Responses-compatible output envelope.

id
string
object
string
model
string
output
object[]
usage
object