curl --request POST \
--url https://hiimpria.ai/api/ai/rtTools/exec \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"function": {
"name": "call_rag",
"arguments": {}
},
"call_id": "<string>",
"assistantId": "<string>",
"conversationId": 123,
"approvalSurface": true,
"backgroundJobs": true,
"jobKey": "<string>",
"turnId": "<string>"
}
'import requests
url = "https://hiimpria.ai/api/ai/rtTools/exec"
payload = {
"function": {
"name": "call_rag",
"arguments": {}
},
"call_id": "<string>",
"assistantId": "<string>",
"conversationId": 123,
"approvalSurface": True,
"backgroundJobs": True,
"jobKey": "<string>",
"turnId": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
function: {name: 'call_rag', arguments: {}},
call_id: '<string>',
assistantId: '<string>',
conversationId: 123,
approvalSurface: true,
backgroundJobs: true,
jobKey: '<string>',
turnId: '<string>'
})
};
fetch('https://hiimpria.ai/api/ai/rtTools/exec', 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://hiimpria.ai/api/ai/rtTools/exec",
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([
'function' => [
'name' => 'call_rag',
'arguments' => [
]
],
'call_id' => '<string>',
'assistantId' => '<string>',
'conversationId' => 123,
'approvalSurface' => true,
'backgroundJobs' => true,
'jobKey' => '<string>',
'turnId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$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://hiimpria.ai/api/ai/rtTools/exec"
payload := strings.NewReader("{\n \"function\": {\n \"name\": \"call_rag\",\n \"arguments\": {}\n },\n \"call_id\": \"<string>\",\n \"assistantId\": \"<string>\",\n \"conversationId\": 123,\n \"approvalSurface\": true,\n \"backgroundJobs\": true,\n \"jobKey\": \"<string>\",\n \"turnId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
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://hiimpria.ai/api/ai/rtTools/exec")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"function\": {\n \"name\": \"call_rag\",\n \"arguments\": {}\n },\n \"call_id\": \"<string>\",\n \"assistantId\": \"<string>\",\n \"conversationId\": 123,\n \"approvalSurface\": true,\n \"backgroundJobs\": true,\n \"jobKey\": \"<string>\",\n \"turnId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/ai/rtTools/exec")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"function\": {\n \"name\": \"call_rag\",\n \"arguments\": {}\n },\n \"call_id\": \"<string>\",\n \"assistantId\": \"<string>\",\n \"conversationId\": 123,\n \"approvalSurface\": true,\n \"backgroundJobs\": true,\n \"jobKey\": \"<string>\",\n \"turnId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"callId": "<string>",
"result": {},
"error": "<string>",
"approval": {
"status": "approved",
"scope": "once",
"decidedAt": "2023-11-07T05:31:56Z"
},
"background": {
"status": "running",
"tool": "<string>"
}
}Execute realtime tool
Executes a tool/function during a realtime AI session. Used for RAG search, web search, and other AI tool capabilities.
curl --request POST \
--url https://hiimpria.ai/api/ai/rtTools/exec \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"function": {
"name": "call_rag",
"arguments": {}
},
"call_id": "<string>",
"assistantId": "<string>",
"conversationId": 123,
"approvalSurface": true,
"backgroundJobs": true,
"jobKey": "<string>",
"turnId": "<string>"
}
'import requests
url = "https://hiimpria.ai/api/ai/rtTools/exec"
payload = {
"function": {
"name": "call_rag",
"arguments": {}
},
"call_id": "<string>",
"assistantId": "<string>",
"conversationId": 123,
"approvalSurface": True,
"backgroundJobs": True,
"jobKey": "<string>",
"turnId": "<string>"
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
function: {name: 'call_rag', arguments: {}},
call_id: '<string>',
assistantId: '<string>',
conversationId: 123,
approvalSurface: true,
backgroundJobs: true,
jobKey: '<string>',
turnId: '<string>'
})
};
fetch('https://hiimpria.ai/api/ai/rtTools/exec', 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://hiimpria.ai/api/ai/rtTools/exec",
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([
'function' => [
'name' => 'call_rag',
'arguments' => [
]
],
'call_id' => '<string>',
'assistantId' => '<string>',
'conversationId' => 123,
'approvalSurface' => true,
'backgroundJobs' => true,
'jobKey' => '<string>',
'turnId' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-access-token: <api-key>"
],
]);
$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://hiimpria.ai/api/ai/rtTools/exec"
payload := strings.NewReader("{\n \"function\": {\n \"name\": \"call_rag\",\n \"arguments\": {}\n },\n \"call_id\": \"<string>\",\n \"assistantId\": \"<string>\",\n \"conversationId\": 123,\n \"approvalSurface\": true,\n \"backgroundJobs\": true,\n \"jobKey\": \"<string>\",\n \"turnId\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-access-token", "<api-key>")
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://hiimpria.ai/api/ai/rtTools/exec")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"function\": {\n \"name\": \"call_rag\",\n \"arguments\": {}\n },\n \"call_id\": \"<string>\",\n \"assistantId\": \"<string>\",\n \"conversationId\": 123,\n \"approvalSurface\": true,\n \"backgroundJobs\": true,\n \"jobKey\": \"<string>\",\n \"turnId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/ai/rtTools/exec")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"function\": {\n \"name\": \"call_rag\",\n \"arguments\": {}\n },\n \"call_id\": \"<string>\",\n \"assistantId\": \"<string>\",\n \"conversationId\": 123,\n \"approvalSurface\": true,\n \"backgroundJobs\": true,\n \"jobKey\": \"<string>\",\n \"turnId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"callId": "<string>",
"result": {},
"error": "<string>",
"approval": {
"status": "approved",
"scope": "once",
"decidedAt": "2023-11-07T05:31:56Z"
},
"background": {
"status": "running",
"tool": "<string>"
}
}Body
The realtime dialect this session was minted in. Required to resolve a bridged MCP connector tool (<serverLabel>__<toolName>); omit it — or send null, which means the same thing — and only built-in tools resolve. Any OTHER value off the list is rejected with 400 INVALID_RT_PROVIDER.
openai_cli, xai_cli, google_cli The conversation thread this realtime session is bound to. Used only to key connector-approval decisions, so that Approve for this conversation can be offered and a standing grant consulted. Ignored unless it is a finite number greater than zero; a malformed value is never an error.
Send true only when the client has an approval row host mounted and can show the decision to the user. Only the boolean true holds the request open for a human decision; absent, false or any other value means the call is answered immediately with the not-available-in-this-channel text.
Send true only when the client can deliver a background result on the next turn (it polls /api/ai/rtTools/jobs). Only the boolean true counts. The call then races the per-turn voice tool budget (VOICE_TOOL_BUDGET_MS, 6 s by default; RT_TOOL_BUDGET=0 switches it off on this lane) and, when it runs longer, keeps running in the background while the model is told it is underway. Needs a job conversation, conversationId or jobKey; without one the call runs as before.
Response
Tool executed successfully
Was this page helpful?