Skip to main content
POST
Generate speech from text

Authorizations

Authorization
string
header
required

Enter the API key with the Bearer: prefix, e.g. "Bearer "

Path Parameters

workspaceID
string
required

The workspace ID used for billing and routing.

Pattern: ^[a-f0-9]{24}$

Body

application/json
input
string
required

The text that should be converted into speech.

The input must contain between 1 and 4096 characters.

Required string length: 1 - 4096
Example:

"Hello, this is a text to speech test."

model
string
required

The text-to-speech model to use.

The model must be one of the TTS models supported by the API.

Example:

"fish-audio/s1"

voice
string

Optional voice identifier supported by the selected TTS model.

Example:

"default"

response_format
enum<string>
default:pcm

The format of the generated audio.

pcm is used by default.

Available options:
mp3,
pcm
Example:

"pcm"

speed
number<float>

The speed of the generated speech.

Values must be between 0.25 and 4.0.

Required range: 0.25 <= x <= 4
Example:

1

input_references
object[]

Optional references that can be provided to the TTS model.

References may contain either audio or text input.

Audio input reference used by supported TTS models.

The exact fields depend on the inputReferenceAudio Joi schema.

provider
object

Optional provider-specific configuration.

Response

Successfully generated speech audio.

The response is of type file.