POST
Get an agent's reply
What the agent says next, given what the caller just said. This is the turn-based path: you hold the call, you decide when to speak, and Voho supplies the reply and the audio for it. Use it when the telephony is yours. If you want Voho to hold the line instead, see Telephony.

How a call is assembled

You send what the caller said and the turns so far. Only the last 20 turns are used, so trim rather than growing the array forever.
The response carries the reply as text and, unless you asked it not to, as base64 audio ready to play down the line.

Variables

variables are per request, and that is the whole point of them: one agent, a different value on every call. Anything you send overrides the defaults stored on the agent, and the values are filled into both the instructions and the greeting.
object
String values, keyed by the variable name used in the agent’s instructions.

Skipping the audio

Set audio to false when you only want the text: a chat channel, a test harness, an evaluation run. The turn is still charged; the synthesis is not.

Cost

Two cents a turn, plus the speech of the reply at the agent’s model rate. Both are in cost_cents and in the X-Voho-Cost-Cents header.
A live call held by Voho is priced by the minute instead, because the line is open whether or not anyone is speaking.

Authorizations

Authorization
string
header
required

API token from the Voho console. Begins with voho_sk_live_.

Path Parameters

id
string
required

The agent's ID, from /v1/agents.

Body

application/json
text
string
required

What the caller said. Truncated at 4,000 characters.

Example:

"وين طلبي؟ رقمه سبعة تسعة واحد اثنين"

history
object[]

The conversation so far. Only the last 20 turns are used.

variables
object

Values for this call. They override the agent's stored defaults, which is the point of them: one agent, a value per call.

Example:
audio
boolean
default:true

Set to false to get text only and skip the synthesis charge.

Response

The reply.

reply
string
greeting
string

The agent's greeting with variables filled in, for the start of a call.

audio
string | null

The spoken reply, base64 encoded. Null when audio was false.

content_type
string | null
Example:

"audio/mpeg"

cost_cents
integer

What this call cost, in cents. Also returned as the X-Voho-Cost-Cents header.