Skip to main content
POST
Say a text in an agent’s voice

Authorizations

Authorization
string
header
required

An org API key (gh_live_…) from Settings → API keys in the console.

Path Parameters

agent_id
string
required

The agent’s id, e.g. billing.

Body

application/json
text
string
required

What to say: a sentence or two at a time.

Maximum string length: 1500
Example:

"这 2.5 天是怎么省掉的?"

conversation_id
string

The conversation this is said in: one with this same agent (another agent’s is a 400, an unknown one a 404). It makes the conversation a web call (its call), unless it is a phone call, a scheduled run, a website widget’s chat or an eval’s conversation already: those stay what they are. Either way the line is written on the conversation’s voice trace (GET /v1/conversations/{conversation_id}/voice) as counts and timings, and its audio is kept with the conversation (GET /v1/conversations/{conversation_id}/audio) unless the agent’s recording is off (GET /v1/agents/{agent_id}/recording). Left out, nothing is kept.

Example:

"conv_8f2k1m0q"

Response

The speech, as MP3.

The response is of type file.