Skip to main content
Voice samples turn a short piece of your own text into speech in any ThunderPhone voice — any catalog voice or any of your organization’s ready custom voices. Use them to audition voices, preview a greeting before an agent goes live, or let your users hear a voice say their own words. Samples are meant for exactly that — sampling. Text is capped at 500 characters and generation is rate limited per organization. If you need longer samples or a higher limit, contact support@thunderphone.com.
Every endpoint on this page requires Authorization: Bearer sk_live_YOUR_API_KEY, except a signed sample URL. Resources are scoped to the organization associated with the credential.

Endpoints

Generate a sample

Response (200 OK)

Pricing and caching

A fresh generation costs from your prepaid balance. Repeating an identical request — same voice, language, and text — is served from cache, costs nothing, and returns "cached": true with a fresh signed URL. That also means expired URLs are cheap to replace: re-send the same request and you get a new one free. Generation is limited to 30 fresh samples per organization per hour; cache hits don’t count against the limit.

Fetch the audio

The url in the response is a signed link to: GET /v1/voices/previews/{id}?sig={signature} It streams audio/mpeg without an Authorization header, so you can hand it straight to an <audio> element or a media player. Signed URLs are valid for 7 days. You can also call the endpoint without sig while authenticated:
An unsigned, unauthenticated request — or one with an invalid or expired signature — returns 401 Unauthorized. A sample generated for another organization’s custom voice returns 404 Not Found.

Errors

The 402, 422, and 429 responses share one shape:
A 422 means the voice exists but ThunderPhone can’t generate ad-hoc samples for it in that language yet — the voice still works normally on calls. Pick another voice or language for the sample.