curl --request POST \
--url https://guidinghand.ai/v1/agents/{agent_id}/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "这 2.5 天是怎么省掉的?",
"conversation_id": "conv_8f2k1m0q"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '这 2.5 天是怎么省掉的?', conversation_id: 'conv_8f2k1m0q'})
};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/agents/{agent_id}/speech"
payload = {
"text": "这 2.5 天是怎么省掉的?",
"conversation_id": "conv_8f2k1m0q"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Say a text in an agent’s voice
The text as speech, in the agent’s voice (its ElevenLabs voice; without one, the default voice), in whatever languages the text is in. For an agent shown in a room or on a screen that speaks what it wrote, with no phone call in between: send each sentence of a streamed reply (POST /v1/agents//responses with stream: true) as it completes, and play the clips in order. Answers the MP3 as it is made (audio/mpeg, 44.1 kHz), so playback can start before the clip is whole. Markdown marks are left out. With conversation_id, the conversation the text belongs to becomes a web call: a conversation held by voice in a browser, listed with phone calls (source=call) and traced. A request that is refused (a 400, 429 or 503) changes nothing. Not charged for now.
curl --request POST \
--url https://guidinghand.ai/v1/agents/{agent_id}/speech \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"text": "这 2.5 天是怎么省掉的?",
"conversation_id": "conv_8f2k1m0q"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({text: '这 2.5 天是怎么省掉的?', conversation_id: 'conv_8f2k1m0q'})
};
fetch('https://guidinghand.ai/v1/agents/{agent_id}/speech', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://guidinghand.ai/v1/agents/{agent_id}/speech"
payload = {
"text": "这 2.5 天是怎么省掉的?",
"conversation_id": "conv_8f2k1m0q"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)"<string>"{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}{
"error": {
"type": "invalid_request",
"message": "<string>",
"code": "<string>",
"test_case_ids": [
"<string>"
],
"decided_by": {
"type": "person",
"email": "<string>",
"key_id": "<string>"
},
"conversation_id": "<string>",
"agent_id": "<string>",
"approval_id": "<string>",
"question_id": "<string>"
}
}Authorizations
Body
What to say: a sentence or two at a time.
1500"这 2.5 天是怎么省掉的?"
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.
"conv_8f2k1m0q"
Response
The speech, as MP3.
The response is of type file.