Resources

Document

Generate lifelike speech from text in multiple languages and voices.

The Text To Speech OpenAI (TTS) API allows you to convert text into high-quality, natural-sounding speech. You can use this API to generate voiceovers for multimedia content, create narrations for e-books and documents, or turn subtitles into engaging audio experiences.

Text To Speech

POST https://api.ttsopenai.com/uapi/v1/text-to-speech

This endpoint allows you to convert text into speech. You can customize the voice, speed, and model used for the conversion.

Required Attributes

model string

The model used for the conversion. You can choose between tts-1 and tts-1-hd. The default value is tts-1.

voice_id string

The voice used for the conversion. You can find the list of voice IDs in the Voice Library. The default value is OA001.

speed float

The speed of the speech. The value should be between 1 and 4. The default value is 1.

input string

The text to be converted into speech. The maximum length is 10,000 characters.

Example Request

curl -X POST https://api.ttsopenai.com/uapi/v1/text-to-speech \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your api key>" \
  -d '{
    "model": "tts-1",
    "voice_id": "OA001",
    "speed": 1,
    "input": "Hello, my name is OpenAI. I am a text-to-speech model."
  }'

Example Response

Response
{
  "uuid": "b1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b",
  "media_url": "https://api.ttsopenai.com/media/b1b3b3b3-3b3b-3b3b-3b3b-3b3b3b3b3b3b.mp3",
  "tts_input": "Hello world!",
  "voice_id": "OA001",
  "speed": 1,
  "status": "completed",
  "model": "tts-1",
  "used_credit": 1,
  "speaker_name": "OpenAI",
  "error_message": null,
  "status_percentage": 100,
  "created_at": "2022-01-01T00:00:00Z",
  "updated_at": "2022-01-01T00:00:00Z"
}

Response Attributes

uuid string

The unique identifier of the TTS Text API request.


The website is jointly operated by A2ZAI LTD No:16078579 Registered address at 83 Green Lanes, London, England, N13 4BS
Copyright © 2024