curl --request POST \
--url https://api.eesi.ai/v1/realtime/client_secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session": {},
"expires_after": {
"anchor": "created_at",
"seconds": 60
},
"eesi_context": {},
"eesi_control": {
"tools": "server"
},
"eesi_lock": [],
"eesi_limits": {
"max_duration_seconds": 5405,
"silence_hangup_seconds": 1802
},
"eesi_webhook": {
"url": "<string>",
"secret": "<string>"
},
"eesi_metadata": {},
"eesi_data": {
"train": true,
"record": true
}
}
'import requests
url = "https://api.eesi.ai/v1/realtime/client_secrets"
payload = {
"session": {},
"expires_after": {
"anchor": "created_at",
"seconds": 60
},
"eesi_context": {},
"eesi_control": { "tools": "server" },
"eesi_lock": [],
"eesi_limits": {
"max_duration_seconds": 5405,
"silence_hangup_seconds": 1802
},
"eesi_webhook": {
"url": "<string>",
"secret": "<string>"
},
"eesi_metadata": {},
"eesi_data": {
"train": True,
"record": True
}
}
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({
session: {},
expires_after: {anchor: 'created_at', seconds: 60},
eesi_context: {},
eesi_control: {tools: 'server'},
eesi_lock: [],
eesi_limits: {max_duration_seconds: 5405, silence_hangup_seconds: 1802},
eesi_webhook: {url: '<string>', secret: '<string>'},
eesi_metadata: {},
eesi_data: {train: true, record: true}
})
};
fetch('https://api.eesi.ai/v1/realtime/client_secrets', 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://api.eesi.ai/v1/realtime/client_secrets",
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([
'session' => [
],
'expires_after' => [
'anchor' => 'created_at',
'seconds' => 60
],
'eesi_context' => [
],
'eesi_control' => [
'tools' => 'server'
],
'eesi_lock' => [
],
'eesi_limits' => [
'max_duration_seconds' => 5405,
'silence_hangup_seconds' => 1802
],
'eesi_webhook' => [
'url' => '<string>',
'secret' => '<string>'
],
'eesi_metadata' => [
],
'eesi_data' => [
'train' => true,
'record' => true
]
]),
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://api.eesi.ai/v1/realtime/client_secrets"
payload := strings.NewReader("{\n \"session\": {},\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 60\n },\n \"eesi_context\": {},\n \"eesi_control\": {\n \"tools\": \"server\"\n },\n \"eesi_lock\": [],\n \"eesi_limits\": {\n \"max_duration_seconds\": 5405,\n \"silence_hangup_seconds\": 1802\n },\n \"eesi_webhook\": {\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"eesi_metadata\": {},\n \"eesi_data\": {\n \"train\": true,\n \"record\": true\n }\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://api.eesi.ai/v1/realtime/client_secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session\": {},\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 60\n },\n \"eesi_context\": {},\n \"eesi_control\": {\n \"tools\": \"server\"\n },\n \"eesi_lock\": [],\n \"eesi_limits\": {\n \"max_duration_seconds\": 5405,\n \"silence_hangup_seconds\": 1802\n },\n \"eesi_webhook\": {\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"eesi_metadata\": {},\n \"eesi_data\": {\n \"train\": true,\n \"record\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eesi.ai/v1/realtime/client_secrets")
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 \"session\": {},\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 60\n },\n \"eesi_context\": {},\n \"eesi_control\": {\n \"tools\": \"server\"\n },\n \"eesi_lock\": [],\n \"eesi_limits\": {\n \"max_duration_seconds\": 5405,\n \"silence_hangup_seconds\": 1802\n },\n \"eesi_webhook\": {\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"eesi_metadata\": {},\n \"eesi_data\": {\n \"train\": true,\n \"record\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"value": "<string>",
"expires_at": 123,
"session": {},
"eesi_lock": [
"<string>"
],
"eesi_control": {},
"eesi_limits": {},
"eesi_webhook": {},
"eesi_metadata": {},
"eesi_data": {}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Create a client secret
A single-use credential that opens a Nur session you already configured, for a browser or a game client.
curl --request POST \
--url https://api.eesi.ai/v1/realtime/client_secrets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"session": {},
"expires_after": {
"anchor": "created_at",
"seconds": 60
},
"eesi_context": {},
"eesi_control": {
"tools": "server"
},
"eesi_lock": [],
"eesi_limits": {
"max_duration_seconds": 5405,
"silence_hangup_seconds": 1802
},
"eesi_webhook": {
"url": "<string>",
"secret": "<string>"
},
"eesi_metadata": {},
"eesi_data": {
"train": true,
"record": true
}
}
'import requests
url = "https://api.eesi.ai/v1/realtime/client_secrets"
payload = {
"session": {},
"expires_after": {
"anchor": "created_at",
"seconds": 60
},
"eesi_context": {},
"eesi_control": { "tools": "server" },
"eesi_lock": [],
"eesi_limits": {
"max_duration_seconds": 5405,
"silence_hangup_seconds": 1802
},
"eesi_webhook": {
"url": "<string>",
"secret": "<string>"
},
"eesi_metadata": {},
"eesi_data": {
"train": True,
"record": True
}
}
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({
session: {},
expires_after: {anchor: 'created_at', seconds: 60},
eesi_context: {},
eesi_control: {tools: 'server'},
eesi_lock: [],
eesi_limits: {max_duration_seconds: 5405, silence_hangup_seconds: 1802},
eesi_webhook: {url: '<string>', secret: '<string>'},
eesi_metadata: {},
eesi_data: {train: true, record: true}
})
};
fetch('https://api.eesi.ai/v1/realtime/client_secrets', 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://api.eesi.ai/v1/realtime/client_secrets",
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([
'session' => [
],
'expires_after' => [
'anchor' => 'created_at',
'seconds' => 60
],
'eesi_context' => [
],
'eesi_control' => [
'tools' => 'server'
],
'eesi_lock' => [
],
'eesi_limits' => [
'max_duration_seconds' => 5405,
'silence_hangup_seconds' => 1802
],
'eesi_webhook' => [
'url' => '<string>',
'secret' => '<string>'
],
'eesi_metadata' => [
],
'eesi_data' => [
'train' => true,
'record' => true
]
]),
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://api.eesi.ai/v1/realtime/client_secrets"
payload := strings.NewReader("{\n \"session\": {},\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 60\n },\n \"eesi_context\": {},\n \"eesi_control\": {\n \"tools\": \"server\"\n },\n \"eesi_lock\": [],\n \"eesi_limits\": {\n \"max_duration_seconds\": 5405,\n \"silence_hangup_seconds\": 1802\n },\n \"eesi_webhook\": {\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"eesi_metadata\": {},\n \"eesi_data\": {\n \"train\": true,\n \"record\": true\n }\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://api.eesi.ai/v1/realtime/client_secrets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"session\": {},\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 60\n },\n \"eesi_context\": {},\n \"eesi_control\": {\n \"tools\": \"server\"\n },\n \"eesi_lock\": [],\n \"eesi_limits\": {\n \"max_duration_seconds\": 5405,\n \"silence_hangup_seconds\": 1802\n },\n \"eesi_webhook\": {\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"eesi_metadata\": {},\n \"eesi_data\": {\n \"train\": true,\n \"record\": true\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eesi.ai/v1/realtime/client_secrets")
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 \"session\": {},\n \"expires_after\": {\n \"anchor\": \"created_at\",\n \"seconds\": 60\n },\n \"eesi_context\": {},\n \"eesi_control\": {\n \"tools\": \"server\"\n },\n \"eesi_lock\": [],\n \"eesi_limits\": {\n \"max_duration_seconds\": 5405,\n \"silence_hangup_seconds\": 1802\n },\n \"eesi_webhook\": {\n \"url\": \"<string>\",\n \"secret\": \"<string>\"\n },\n \"eesi_metadata\": {},\n \"eesi_data\": {\n \"train\": true,\n \"record\": true\n }\n}"
response = http.request(request)
puts response.read_body{
"value": "<string>",
"expires_at": 123,
"session": {},
"eesi_lock": [
"<string>"
],
"eesi_control": {},
"eesi_limits": {},
"eesi_webhook": {},
"eesi_metadata": {},
"eesi_data": {}
}{
"error": {
"message": "<string>",
"type": "<string>",
"param": "<string>",
"code": "<string>"
}
}Authorizations
Your EESI API key, sk-eesi-....
Body
A session fixed now and opened later by a client that holds no key.
The OpenAI shape (session, expires_after) plus two EESI fields:
eesi_context, the live-state blocks the session starts with, as
eesi.context.update would set them; and eesi_lock, what the client
may not change.
A session.update body: instructions, audio, tools, ...
Show child attributes
Show child attributes
Live-state blocks by key, with the limits of eesi.context.update.
Show child attributes
Show child attributes
Open a server control channel with the session: your server joins at /v1/realtime/control/{id}, sees its events and acts in it.
Show child attributes
Show child attributes
What the client may not change: instructions, tools, voice, turn_detection, context, conversation, or all. Defaults to instructions and tools.
instructions, tools, voice, turn_detection, context, conversation A maximum call length and a silence hang-up, beyond the client.
Show child attributes
Show child attributes
Post each reply and the session's end to your server, signed.
Show child attributes
Show child attributes
Your own tags (at most 16), echoed in every webhook.
Show child attributes
Show child attributes
Keep the session out of training, or out of storage.
Show child attributes
Show child attributes
Response
Successful Response
The credential and the session it opens.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes