curl --request POST \
--url https://app.voho.ai/v1/agents/{id}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "وين طلبي؟ رقمه سبعة تسعة واحد اثنين",
"history": [
{
"text": "<string>"
}
],
"variables": {
"customer_name": "أحمد",
"branch": "الملز"
},
"audio": true
}
'import requests
url = "https://app.voho.ai/v1/agents/{id}/reply"
payload = {
"text": "وين طلبي؟ رقمه سبعة تسعة واحد اثنين",
"history": [{ "text": "<string>" }],
"variables": {
"customer_name": "أحمد",
"branch": "الملز"
},
"audio": 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({
text: 'وين طلبي؟ رقمه سبعة تسعة واحد اثنين',
history: [{text: '<string>'}],
variables: {customer_name: 'أحمد', branch: 'الملز'},
audio: true
})
};
fetch('https://app.voho.ai/v1/agents/{id}/reply', 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://app.voho.ai/v1/agents/{id}/reply",
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([
'text' => 'وين طلبي؟ رقمه سبعة تسعة واحد اثنين',
'history' => [
[
'text' => '<string>'
]
],
'variables' => [
'customer_name' => 'أحمد',
'branch' => 'الملز'
],
'audio' => 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://app.voho.ai/v1/agents/{id}/reply"
payload := strings.NewReader("{\n \"text\": \"وين طلبي؟ رقمه سبعة تسعة واحد اثنين\",\n \"history\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"variables\": {\n \"customer_name\": \"أحمد\",\n \"branch\": \"الملز\"\n },\n \"audio\": true\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://app.voho.ai/v1/agents/{id}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"وين طلبي؟ رقمه سبعة تسعة واحد اثنين\",\n \"history\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"variables\": {\n \"customer_name\": \"أحمد\",\n \"branch\": \"الملز\"\n },\n \"audio\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.voho.ai/v1/agents/{id}/reply")
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 \"text\": \"وين طلبي؟ رقمه سبعة تسعة واحد اثنين\",\n \"history\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"variables\": {\n \"customer_name\": \"أحمد\",\n \"branch\": \"الملز\"\n },\n \"audio\": true\n}"
response = http.request(request)
puts response.read_body{
"reply": "<string>",
"greeting": "<string>",
"audio": "<string>",
"content_type": "audio/mpeg",
"cost_cents": 123
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API token."
}
}{
"error": {
"code": "insufficient_credit",
"message": "Your credit balance is exhausted. Top up to continue."
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Get an agent's reply
What the agent says next, given what the caller just said. Text in, text and audio out, so your own telephony can drive an agent configured in the console.
Billed 2 cents a turn, plus the speech of the reply at the agent’s model rate.
curl --request POST \
--url https://app.voho.ai/v1/agents/{id}/reply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "وين طلبي؟ رقمه سبعة تسعة واحد اثنين",
"history": [
{
"text": "<string>"
}
],
"variables": {
"customer_name": "أحمد",
"branch": "الملز"
},
"audio": true
}
'import requests
url = "https://app.voho.ai/v1/agents/{id}/reply"
payload = {
"text": "وين طلبي؟ رقمه سبعة تسعة واحد اثنين",
"history": [{ "text": "<string>" }],
"variables": {
"customer_name": "أحمد",
"branch": "الملز"
},
"audio": 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({
text: 'وين طلبي؟ رقمه سبعة تسعة واحد اثنين',
history: [{text: '<string>'}],
variables: {customer_name: 'أحمد', branch: 'الملز'},
audio: true
})
};
fetch('https://app.voho.ai/v1/agents/{id}/reply', 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://app.voho.ai/v1/agents/{id}/reply",
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([
'text' => 'وين طلبي؟ رقمه سبعة تسعة واحد اثنين',
'history' => [
[
'text' => '<string>'
]
],
'variables' => [
'customer_name' => 'أحمد',
'branch' => 'الملز'
],
'audio' => 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://app.voho.ai/v1/agents/{id}/reply"
payload := strings.NewReader("{\n \"text\": \"وين طلبي؟ رقمه سبعة تسعة واحد اثنين\",\n \"history\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"variables\": {\n \"customer_name\": \"أحمد\",\n \"branch\": \"الملز\"\n },\n \"audio\": true\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://app.voho.ai/v1/agents/{id}/reply")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"text\": \"وين طلبي؟ رقمه سبعة تسعة واحد اثنين\",\n \"history\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"variables\": {\n \"customer_name\": \"أحمد\",\n \"branch\": \"الملز\"\n },\n \"audio\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.voho.ai/v1/agents/{id}/reply")
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 \"text\": \"وين طلبي؟ رقمه سبعة تسعة واحد اثنين\",\n \"history\": [\n {\n \"text\": \"<string>\"\n }\n ],\n \"variables\": {\n \"customer_name\": \"أحمد\",\n \"branch\": \"الملز\"\n },\n \"audio\": true\n}"
response = http.request(request)
puts response.read_body{
"reply": "<string>",
"greeting": "<string>",
"audio": "<string>",
"content_type": "audio/mpeg",
"cost_cents": 123
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "unauthorized",
"message": "Invalid or missing API token."
}
}{
"error": {
"code": "insufficient_credit",
"message": "Your credit balance is exhausted. Top up to continue."
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>"
}
}Authorizations
API token from the Voho console. Begins with voho_sk_live_.
Path Parameters
The agent's ID, from /v1/agents.
Body
What the caller said. Truncated at 4,000 characters.
"وين طلبي؟ رقمه سبعة تسعة واحد اثنين"
The conversation so far. Only the last 20 turns are used.
Show child attributes
Show child attributes
Values for this call. They override the agent's stored defaults, which is the point of them: one agent, a value per call.
Show child attributes
Show child attributes
{
"customer_name": "أحمد",
"branch": "الملز"
}
Set to false to get text only and skip the synthesis charge.
Response
The reply.
The agent's greeting with variables filled in, for the start of a call.
The spoken reply, base64 encoded. Null when audio was false.
"audio/mpeg"
What this call cost, in cents. Also returned as the X-Voho-Cost-Cents header.

