API Reference

Creates a new Text-to-Speech (TTS) job that converts input text into audio asynchronously.

The API response varies based on the accept header, providing either the job data or a Server-Sent Events (SSE) text event-stream to track the job's progress.

If the header contains accept: application/json, the API responds with information about the newly created TTS job:

  • Status: 201 - Created
  • Header: Location: /api/v2/tts/{id} - the URL for the recently-created job
  • Body: Job data (identical to the response from GET /api/v2/tts/{id})

If the header contains accept: text/event-stream or accept: */*, or the query param ?format=event-stream is present, the endpoint responds with a job creation progress SSE text event-stream:

  • Status: 201 - Created
  • Headers:
    • Location: /api/v2/tts/{id} - the URL for the recently-created job
    • Content-Location: /api/v2/tts/{id}?format=event-stream - the URL for the SSE stream
  • Body: An event stream (same as /api/v2/tts/{id}?format=event-stream)

NOTE: The created jobs are ephemeral and will be deleted after 48 hours. The generated files, on the other hand, are permanent and will be available for download for at least 30 days.

Language
Authorization
Click Try It! to start a request and see the response here!