Open a session without an API key
curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session \
--header 'Content-Type: application/json' \
--data '
{
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic-demo"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session"
payload = {
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic-demo"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({participantName: 'عائشہ صدیقی', roomName: 'shifa-clinic-demo'})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session', 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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session",
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([
'participantName' => 'عائشہ صدیقی',
'roomName' => 'shifa-clinic-demo'
]),
CURLOPT_HTTPHEADER => [
"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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session"
payload := strings.NewReader("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic-demo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session")
.header("Content-Type", "application/json")
.body("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic-demo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic-demo\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6InNoaWZhLWNsaW5pYy1kZS02Mjcw…",
"wsUrl": "wss://upliftai-prod-yd34to8b.livekit.cloud",
"roomName": "shifa-clinic-de-6270e96c-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}{
"message": [
"participantName should not be empty",
"participantName must be a string"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "Insufficient credits to start a realtime session",
"error": "Payment Required",
"statusCode": 402
}{
"message": "Assistant is not available publicly",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Realtime assistant not found: 00000000-0000-4000-8000-000000000000",
"error": "Not Found",
"statusCode": 404
}{
"message": "Published version 14 of assistant 0f4a91d3-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not readable yet",
"statusCode": 503
}Starting a conversation
Open a session without an API key
Open a web session with no API key, so client-side code can mint its own token. Works only for assistants marked public, which makes the assistant id the entire credential: anyone who reads it out of your page source can start sessions billed to your organization. The assistant joins the room once the client connects.
POST
/
realtime-assistants
/
{realtimeAssistantId}
/
public-session
Open a session without an API key
curl --request POST \
--url https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session \
--header 'Content-Type: application/json' \
--data '
{
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic-demo"
}
'import requests
url = "https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session"
payload = {
"participantName": "عائشہ صدیقی",
"roomName": "shifa-clinic-demo"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({participantName: 'عائشہ صدیقی', roomName: 'shifa-clinic-demo'})
};
fetch('https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session', 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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session",
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([
'participantName' => 'عائشہ صدیقی',
'roomName' => 'shifa-clinic-demo'
]),
CURLOPT_HTTPHEADER => [
"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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session"
payload := strings.NewReader("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic-demo\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session")
.header("Content-Type", "application/json")
.body("{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic-demo\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.upliftai.org/v1/realtime-assistants/{realtimeAssistantId}/public-session")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"participantName\": \"عائشہ صدیقی\",\n \"roomName\": \"shifa-clinic-demo\"\n}"
response = http.request(request)
puts response.read_body{
"token": "eyJhbGciOiJIUzI1NiJ9.eyJ2aWRlbyI6eyJyb29tSm9pbiI6dHJ1ZSwicm9vbSI6InNoaWZhLWNsaW5pYy1kZS02Mjcw…",
"wsUrl": "wss://upliftai-prod-yd34to8b.livekit.cloud",
"roomName": "shifa-clinic-de-6270e96c-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}{
"message": [
"participantName should not be empty",
"participantName must be a string"
],
"error": "Bad Request",
"statusCode": 400
}{
"message": "Insufficient credits to start a realtime session",
"error": "Payment Required",
"statusCode": 402
}{
"message": "Assistant is not available publicly",
"error": "Forbidden",
"statusCode": 403
}{
"message": "Realtime assistant not found: 00000000-0000-4000-8000-000000000000",
"error": "Not Found",
"statusCode": 404
}{
"message": "Published version 14 of assistant 0f4a91d3-xxxx-xxxx-xxxx-xxxxxxxxxxxx is not readable yet",
"statusCode": 503
}Path Parameters
Body
application/json
Response
Credentials for the browser client. The agent joins once the client connects.
