Preview

Generates speech audio for the provided text and returns it as a single base64-encoded string.

Authentication

AuthorizationBearer
Bearer authentication header of the form `Bearer <PHONIC_API_KEY>`. Manage your API keys [here](https://phonic.co/api-keys).

Request

This endpoint expects an object.
textstringRequired>=1 character
The text to convert to speech.
modelenumOptionalDefaults to merritt
The TTS model to use.
speeddoubleOptional0.5-1.5Defaults to 1.2
The speech speed.
voice_idstringOptionalDefaults to sabrina
The voice ID to use.
output_formatenumOptionalDefaults to pcm_44100
The audio format to stream.
languageslist of enumsOptionalDefaults to []
Candidate languages for synthesis. An empty array defaults to English, one language selects it directly, and multiple languages let Phonic detect among those candidates.

Response

The generated audio.
audiostring

The generated speech, base64-encoded in the requested output_format.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error