Webhook events for text-to-speech generation
The Talk API generates events when speech audio is synthesized. These events are delivered through the unified do.dev webhook system.
| Event Type | Trigger | Description |
|---|---|---|
talk.speech.generated | POST /v1/talk/speech | Text-to-speech audio generated |
Fired after speech audio is successfully generated.
{
"eventId": "evt_c3d4e5f6-a7b8-9012-cdef-123456789012",
"type": "talk.speech.generated",
"service": "talk",
"data": {
"voice": "asteria",
"format": "mp3",
"textLength": 256,
"speed": 1.0
},
"livemode": true,
"createdAt": 1700000000000
}| Field | Type | Description |
|---|---|---|
data.voice | string | Voice ID used for synthesis (e.g., asteria, orion) |
data.format | string | Audio format requested (mp3, wav, flac, aac, opus) |
data.textLength | number | Character count of the input text |
data.speed | number | Playback speed multiplier (0.5 - 2.0) |
Create a webhook endpoint that listens to talk events:
curl -X POST https://api.do.dev/v1/webhooks \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com/webhooks",
"enabled_events": ["talk.*"]
}'