Generate speech
Synthesizes speech from text and returns raw audio bytes, streamed when the provider supports it.
Synthesizes speech from text and returns raw audio bytes, streamed when the provider supports it.
Authorization
bearerAuth API key
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/problem+json
application/problem+json
application/json
curl -X POST "https://example.com/v1/audio/speech" \ -H "Authorization: Bearer $SPEECHBASE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "mode": "voice", "voiceId": "string", "text": "string"}'"string"{
"type": "string",
"title": "string",
"status": 0,
"detail": "string"
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string"
}{
"error": {
"code": "content_moderation_blocked",
"message": "string",
"reason": {
"type": "error_fail_closed"
}
}
}