Audio

Create Speech

This endpoint is compatible with the OpenAI library.<br/>Generates audio from the input text.

post/v1/audio/speech

Request

  • Base URL: https://api.fanar.qa (the document declares no server; this is the origin it was published from)
  • URL: https://api.fanar.qa/v1/audio/speech
  • Auth: HTTP bearer

Request body

model'Fanar-Aura-TTS-2' | 'Fanar-Sadiq-TTS-1' required
inputstring required

The text to generate audio for.

voice'Abdulrahman' | 'Amelia' | 'Emily' | 'Hamad' | 'Harry' | 'Huda' | 'Jake' | 'Jasim' | 'Noor' | 'Radwa' required

The voice to use for the text-to-speech. Details are below:

<table style="min-width:600px"><thead><tr><th nowrap width="160">Voice</th><th nowrap width="80">Gender</th><th nowrap width="180">Supported Languages</th><th nowrap width="100">Accent</th><th nowrap width="80">Emotion</th></tr></thead><tbody><tr><td nowrap>Abdulrahman</td><td nowrap>Male</td><td><a href="https://chat.fanar.qa/api/sample-voices/ar/Abdulrahman">Arabic</a></td><td nowrap>Standard</td><td nowrap>✓</td></tr><tr><td nowrap>Amelia</td><td nowrap>Female</td><td><a href="https://chat.fanar.qa/api/sample-voices/en/Amelia">English</a></td><td nowrap>British</td><td nowrap>—</td></tr><tr><td nowrap>Emily</td><td nowrap>Female</td><td><a href="https://chat.fanar.qa/api/sample-voices/en/Emily">English</a></td><td nowrap>American</td><td nowrap>—</td></tr><tr><td nowrap>Hamad</td><td nowrap>Male</td><td><a href="https://chat.fanar.qa/api/sample-voices/ar/Hamad">Arabic</a></td><td nowrap>Standard</td><td nowrap>—</td></tr><tr><td nowrap>Harry</td><td nowrap>Male</td><td><a href="https://chat.fanar.qa/api/sample-voices/en/Harry">English</a></td><td nowrap>British</td><td nowrap>—</td></tr><tr><td nowrap>Huda</td><td nowrap>Female</td><td><a href="https://chat.fanar.qa/api/sample-voices/ar/Huda">Arabic</a></td><td nowrap>Standard</td><td nowrap>—</td></tr><tr><td nowrap>Jake</td><td nowrap>Male</td><td><a href="https://chat.fanar.qa/api/sample-voices/en/Jake">English</a></td><td nowrap>American</td><td nowrap>—</td></tr><tr><td nowrap>Jasim</td><td nowrap>Male</td><td><a href="https://chat.fanar.qa/api/sample-voices/ar/Jasim">Arabic</a></td><td nowrap>Standard</td><td nowrap>—</td></tr><tr><td nowrap>Noor</td><td nowrap>Female</td><td><a href="https://chat.fanar.qa/api/sample-voices/ar/Noor">Arabic</a></td><td nowrap>Standard</td><td nowrap>—</td></tr><tr><td nowrap>Radwa</td><td nowrap>Female</td><td><a href="https://chat.fanar.qa/api/sample-voices/ar/Radwa">Arabic</a></td><td nowrap>Standard</td><td nowrap>✓</td></tr></tbody></table>
response_format'mp3' | 'wav'
quran_reciter'abdul-basit' | 'maher-al-muaiqly' | 'mahmoud-al-husary'
with_emotionboolean

Enable emotional speech synthesis. Only applicable to Fanar-Aura-TTS-2 and to voices where emotion: true in GET /v1/voices. When the selected voice does not support emotion, or when used with Fanar-Sadiq-TTS-1, the request is rejected with a 422 error. Defaults to false.

streamboolean

Stream the audio as it is generated. Supported for both wav and mp3.

Example request

{
  "model": "Fanar-Aura-TTS-2",
  "input": "Hello, welcome to Fanar!",
  "voice": "Harry"
}

Response

The audio file content or error details.

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.