Speko Docs
API Reference

Synthesize

Routes the request to the best TTS provider for your intent, with automatic failover. Returns binary audio. The `Content-Type` header (mirrored in `X-Speko-Audio-Format`) tells you the format.

POST
/v1/synthesize

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/octet-stream

application/json

application/json

application/json

"string"
{
  "error": "Invalid request body",
  "code": "VALIDATION_ERROR"
}
{
  "error": "Unauthorized",
  "code": "UNAUTHORIZED"
}
{
  "error": "All providers failed",
  "code": "SYNTHESIZE_FAILED"
}