Text To Dialogue V3 Webhook Guide — Async Task Callbacks
Use Text To Dialogue V3 webhooks when your app cannot keep a browser or server request open while a text to speech task completes. Submit the task to `https://97ai.97claude.com/api/generate` with `webhook_url`, store the returned task id, and treat polling as a fallback. Pricing is pay-per-use pricing and failed generations cost $0.
Create a task with webhook_url
Send the generation request from your backend and include a callback URL that your app controls.
curl -X POST https://97ai.97claude.com/api/generate \
-H "Authorization: Bearer $YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"elevenlabs/text-to-dialogue-v3","input":{"prompt":"A cinematic product shot"},"webhook_url":"https://your-app.com/webhooks/97ai"}'
Task state machine
| State | Meaning | Action |
|---|---|---|
| PENDING | Task accepted and queued | Store taskId and show an in-progress state |
| SUCCESS | Generation completed | Save resultUrls, creditsConsumed, and prompt metadata |
| FAILURE | Generation failed upstream | Show the error and keep billing at $0 for the failed task |
Webhook handler checklist
- Accept only POST requests at your callback URL.
- Verify the task id exists in your database before updating state.
- Make the handler idempotent; the same terminal event may be delivered more than once.
- Store `resultUrls`, final state, credits consumed, and the original prompt metadata.
- Keep polling `GET https://97ai.97claude.com/api/generate/{taskId}` as a fallback if your callback endpoint is unavailable.
Frequently asked questions
Does Text To Dialogue V3 support webhooks?+
Yes. Include `webhook_url` when you create the Text To Dialogue V3 generation task through 97AI.PRO.
Should I use polling or webhooks for Text To Dialogue V3?+
Use webhooks for production and polling for local testing or fallback recovery. Both patterns can coexist safely.
What happens if my webhook endpoint is down?+
Keep the task id and poll the task details endpoint. Your result remains available after the generation finishes.
Are failed Text To Dialogue V3 tasks billed?+
No. Failed tasks cost $0 under 97AI.PRO's zero-risk billing policy.
Can I use a localhost webhook while developing?+
Use a tunnel such as ngrok or Cloudflare Tunnel so 97AI.PRO can reach your local callback endpoint.
Ready to try Text To Dialogue V3?
Sign up on 97AI.PRO, top up with credit card / USDC / Alipay, and get an API key in under 60 seconds.
