Developers

Build natural voice into anything.

Generate production-ready speech from a simple HTTP request. Choose a voice, send your text and receive an audio file ready for your product or workflow.

Quickstart

Create an API key from your workspace, then send your first request to the speech endpoint. Replace the example key and voice ID with values from your account.

curl --request POST \
  --url https://texttoaudio.lol/api/v1/speech \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "text": "Welcome to TextToAudio.",
    "voice_id": "radhika",
    "format": "mp3",
    "sample_rate": 48000
  }'

Authentication

Authenticate with a bearer token in the Authorization header. Keep API keys on your server and rotate them immediately if a key is exposed. Browser-side keys are not supported.

Request parameters

  • text: the script to synthesize, up to the character limit for your plan.
  • voice_id: a stable identifier from the voice catalogue.
  • format: mp3, wav, ogg, aac or opus.
  • sample_rate: 22050, 44100 or 48000 Hz.
  • speed, pitch and volume: optional studio adjustments.

Responses and errors

Successful requests return an audio URL and request metadata. A 401 response indicates an invalid key or expired session, 422 indicates invalid input, and 429 indicates a rate limit. Retry transient 5xx responses with exponential backoff.

Rate limits and concurrency

Rate limits depend on your plan. The response headers include the current limit, remaining requests and reset window. Batch large jobs and queue requests to stay inside your concurrency allowance.

Production checklist

  • Store API keys in a secrets manager, never in source control.
  • Validate and truncate text before sending requests.
  • Handle timeouts and retries idempotently.
  • Cache generated audio when the same script is requested repeatedly.
  • Log request IDs to simplify support investigations.

Developer support

Need an enterprise allowance or integration review? Email our team at developers@texttoaudio.lol

Our support team replies within one business day, Monday through Friday.

Build natural voice into anything. — TextToAudio