curl --request POST \
--url https://{region}.context-router.slng.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "slng/auto",
"input": "<string>",
"instructions": "<string>",
"stream": true,
"template_variables": {
"caller_name": "Rajesh",
"city": "Mumbai"
},
"slng_agent_id": "<string>",
"slng_session_id": "<string>",
"slng_analytics": false,
"slng_pure_proxy": false
}
'import requests
url = "https://{region}.context-router.slng.ai/v1/responses"
payload = {
"model": "slng/auto",
"input": "<string>",
"instructions": "<string>",
"stream": True,
"template_variables": {
"caller_name": "Rajesh",
"city": "Mumbai"
},
"slng_agent_id": "<string>",
"slng_session_id": "<string>",
"slng_analytics": False,
"slng_pure_proxy": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'slng/auto',
input: '<string>',
instructions: '<string>',
stream: true,
template_variables: {caller_name: 'Rajesh', city: 'Mumbai'},
slng_agent_id: '<string>',
slng_session_id: '<string>',
slng_analytics: false,
slng_pure_proxy: false
})
};
fetch('https://{region}.context-router.slng.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{region}.context-router.slng.ai/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'slng/auto',
'input' => '<string>',
'instructions' => '<string>',
'stream' => true,
'template_variables' => [
'caller_name' => 'Rajesh',
'city' => 'Mumbai'
],
'slng_agent_id' => '<string>',
'slng_session_id' => '<string>',
'slng_analytics' => false,
'slng_pure_proxy' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{region}.context-router.slng.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"slng/auto\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"stream\": true,\n \"template_variables\": {\n \"caller_name\": \"Rajesh\",\n \"city\": \"Mumbai\"\n },\n \"slng_agent_id\": \"<string>\",\n \"slng_session_id\": \"<string>\",\n \"slng_analytics\": false,\n \"slng_pure_proxy\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{region}.context-router.slng.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"slng/auto\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"stream\": true,\n \"template_variables\": {\n \"caller_name\": \"Rajesh\",\n \"city\": \"Mumbai\"\n },\n \"slng_agent_id\": \"<string>\",\n \"slng_session_id\": \"<string>\",\n \"slng_analytics\": false,\n \"slng_pure_proxy\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.context-router.slng.ai/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"slng/auto\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"stream\": true,\n \"template_variables\": {\n \"caller_name\": \"Rajesh\",\n \"city\": \"Mumbai\"\n },\n \"slng_agent_id\": \"<string>\",\n \"slng_session_id\": \"<string>\",\n \"slng_analytics\": false,\n \"slng_pure_proxy\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"output": [
{}
],
"usage": {}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "missing_client_id"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "missing_client_id"
}
}Create a response (OpenAI Responses protocol)
Route an OpenAI Responses request. Uses input and instructions; returns an
output array. Additional Responses fields pass through.
curl --request POST \
--url https://{region}.context-router.slng.ai/v1/responses \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "slng/auto",
"input": "<string>",
"instructions": "<string>",
"stream": true,
"template_variables": {
"caller_name": "Rajesh",
"city": "Mumbai"
},
"slng_agent_id": "<string>",
"slng_session_id": "<string>",
"slng_analytics": false,
"slng_pure_proxy": false
}
'import requests
url = "https://{region}.context-router.slng.ai/v1/responses"
payload = {
"model": "slng/auto",
"input": "<string>",
"instructions": "<string>",
"stream": True,
"template_variables": {
"caller_name": "Rajesh",
"city": "Mumbai"
},
"slng_agent_id": "<string>",
"slng_session_id": "<string>",
"slng_analytics": False,
"slng_pure_proxy": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'slng/auto',
input: '<string>',
instructions: '<string>',
stream: true,
template_variables: {caller_name: 'Rajesh', city: 'Mumbai'},
slng_agent_id: '<string>',
slng_session_id: '<string>',
slng_analytics: false,
slng_pure_proxy: false
})
};
fetch('https://{region}.context-router.slng.ai/v1/responses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{region}.context-router.slng.ai/v1/responses",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'slng/auto',
'input' => '<string>',
'instructions' => '<string>',
'stream' => true,
'template_variables' => [
'caller_name' => 'Rajesh',
'city' => 'Mumbai'
],
'slng_agent_id' => '<string>',
'slng_session_id' => '<string>',
'slng_analytics' => false,
'slng_pure_proxy' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{region}.context-router.slng.ai/v1/responses"
payload := strings.NewReader("{\n \"model\": \"slng/auto\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"stream\": true,\n \"template_variables\": {\n \"caller_name\": \"Rajesh\",\n \"city\": \"Mumbai\"\n },\n \"slng_agent_id\": \"<string>\",\n \"slng_session_id\": \"<string>\",\n \"slng_analytics\": false,\n \"slng_pure_proxy\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{region}.context-router.slng.ai/v1/responses")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"slng/auto\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"stream\": true,\n \"template_variables\": {\n \"caller_name\": \"Rajesh\",\n \"city\": \"Mumbai\"\n },\n \"slng_agent_id\": \"<string>\",\n \"slng_session_id\": \"<string>\",\n \"slng_analytics\": false,\n \"slng_pure_proxy\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{region}.context-router.slng.ai/v1/responses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"slng/auto\",\n \"input\": \"<string>\",\n \"instructions\": \"<string>\",\n \"stream\": true,\n \"template_variables\": {\n \"caller_name\": \"Rajesh\",\n \"city\": \"Mumbai\"\n },\n \"slng_agent_id\": \"<string>\",\n \"slng_session_id\": \"<string>\",\n \"slng_analytics\": false,\n \"slng_pure_proxy\": false\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "<string>",
"model": "<string>",
"output": [
{}
],
"usage": {}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "missing_client_id"
}
}{
"error": {
"message": "<string>",
"type": "invalid_request_error",
"param": "<string>",
"code": "missing_client_id"
}
}Authorizations
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
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.
256^[^\s,|{}]+$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.
256^[^\s,|{}]+$Optional correlation ID, echoed back in x-slng-request-id. X-Request-Id is also
accepted.
Body
OpenAI Responses body (input and instructions), plus the same SLNG extensions as Chat Completions.
Responses-protocol input.
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.
Show child attributes
Show child attributes
{ "caller_name": "Rajesh", "city": "Mumbai" }
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).
Show child attributes
Show child attributes
Opaque ID. Max 256 characters; no whitespace, commas, pipes or braces.
256^[^\s,|{}]+$Opaque ID. Max 256 characters; no whitespace, commas, pipes or braces.
256^[^\s,|{}]+$