latestOpenAPI 3.1.02026-08-153781,4521.9 MB

acb0175c0525

Flows
Text to Speech

Create Speech Generation

Start a speech generation with the selected model. Charged per character via text-to-speech billing. Use this over /v1/text-to-speech for the asynchronous generation lifecycle or for models not offered there; for direct, synchronous speech synthesis, prefer /v1/text-to-speech.

post/v1/flows/text-to-speech

Headers

xi-api-keystring nullable

Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

Request body

OR
OR

Example request

{
  "webhook": {
    "ids": [
      "Q8mVr2LpXcT4nB6yJdKw"
    ]
  },
  "text": "The first move is what sets everything in motion.",
  "voice": "JBFqnCBsd6RMkjVDRZzb",
  "pronunciation_dictionary_locators": [
    {
      "pronunciation_dictionary_id": "5xM3yVvZQKV0EfqQpLrJ"
    }
  ],
  "language_code": "en"
}

Response

Successful Response

idstring required

The unique identifier of the generation. Pass it to the corresponding GET endpoint to retrieve the output.

status'pending' required

A newly created generation is always pending.

Example response

{
  "id": "JWr5N6X9ZTqf8jD2LmQb",
  "status": "pending"
}