Voice
Get a voice live WebSocket token
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Header Parameters
Request host (used to build WebSocket URL)
Forwarded protocol (http/https)
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/voice/live-ws-token" \ -H "Content-Type: application/json" \ -d '{}'{
"$schema": "/api/v1/schemas/VoiceLiveWSTokenOutputBody.json",
"authToken": "string",
"wsUrl": "string"
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Convert speech to text
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/voice/stt" \ -H "Content-Type: application/json" \ -d '{ "audio": "string", "audioFormat": "string" }'null{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Convert text to speech
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Path Parameters
Agent UUID or URL-encoded agent name
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
curl -X POST "https://loading/api/v1/agents/string/voice/tts" \ -H "Content-Type: application/json" \ -d '{ "text": "string" }'null{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}List available voices
API key issued to a Sonzai project. Format: Bearer sk_....
In: header
Query Parameters
Filter by gender (e.g. male, female)
Response Body
application/json
application/problem+json
curl -X GET "https://loading/api/v1/voices"{
"$schema": "/api/v1/schemas/ListVoicesResponse.json",
"voices": [
{
"gender": "string",
"name": "string"
}
]
}{
"$schema": "/api/v1/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "string",
"message": "string",
"value": null
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}