API Reference / Endpoints / Speech
Text to speech
/v1/speech/text-to-speechGenerate speech asynchronously from text.
POST
/v1/speech/text-to-speechAuth: API keyBilling: Consumes 1 API callBehavior: AsyncScopes: audio:generate
POSTAsyncjsonaudio:generate
When to use it
Use this when you want standard non-streaming TTS with request polling or webhooks.
Behavior on success
Returns 202 Accepted with a request_id. Poll the status endpoint or use webhooks.
Integration shape
Authorization model
audio:generate
Request format
json
Polling pattern
Poll status if the route returns processing.
Request
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Input text to synthesize. |
voice_id | string | Optional | Optional voice selection. |
model_id | string | Optional | Optional public speech model id. |
Example request
POST /v1/speech/text-to-speech
const response = await fetch('https://prod-backup-backend.wubble.ai/v1/speech/text-to-speech', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.WUBBLE_API_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
"text": "Hello from the Wubble speech API.",
"voice_id": "voice_123"
}),
});
const payload = await response.json();
console.log(payload);Example response
Response shapejson
{
"success": true,
"data": {
"request_id": "<uuid>",
"status": "processing",
"estimated_seconds": 5
}
}Production guidance
Pair this route with idempotency on POST requests and either request polling or webhooks whenever the response is asynchronous.
Was this page helpful?