OpenAPI v1
post/v1/tts

Request

  • Base URL
    https://api.fish.audio
  • URL
    https://api.fish.audio/v1/tts
  • Auth
    HTTP bearer

Headers

model's1' | 's2-pro' | 's2.1-pro' | 's2.1-pro-free' | 'drama-3'

Specify which TTS model to use. Use s2.1-pro-free for the free developer tier. If omitted or set to an unrecognized value, the request falls back to s2.1-pro.

Request body

textstring required

Text to convert to speech.

temperaturenumber

Controls expressiveness. Higher is more varied, lower is more consistent.

top_pnumber

Controls diversity via nucleus sampling.

chunk_lengthinteger

Text segment size for processing.

normalizeboolean

Rewrites numbers, dates, units and symbols as spoken words before synthesis, improving stability. Uses language when it is set and otherwise detects the language of each text chunk.

languagestring nullable

BCP-47 language tag of the text, for example en, es-MX or zh-CN. Case-insensitive, and _ is read as -. Used only by text normalization (how numbers, dates, units and symbols are spelled out before synthesis) and by word-timestamp alignment. It is not passed to the speech model and does not change the voice, accent or audio quality; a wrong tag only changes how those tokens are spelled out. Omit it, or send auto or an empty string, to detect the language per chunk. A tag without dedicated normalization rules skips normalization instead of failing. Without a region, Spanish follows Spain conventions; send es-MX for Mexican readings. When normalize is false it only affects word timestamps. For text that mixes languages, leave it unset.

format'wav' | 'pcm' | 'mp3' | 'opus'

Output audio format.

sample_rateinteger nullable

Audio sample rate in Hz. When null, uses the format's default (44100 Hz for most formats, 48000 Hz for opus).

mp3_bitrate64 | 128 | 192

MP3 bitrate in kbps. Only applies when format is mp3.

opus_bitrate-1000 | 24000 | 32000 | 48000 | 64000

Opus bitrate in bps. -1000 for automatic. Only applies when format is opus.

latency'low' | 'normal' | 'balanced'

Latency-quality trade-off. normal: best quality, balanced: reduced latency, low: lowest latency.

max_new_tokensinteger

Maximum audio tokens to generate per text chunk.

repetition_penaltynumber

Penalty for repeating audio patterns. Values above 1.0 reduce repetition.

min_chunk_lengthinteger

Minimum characters before splitting into a new chunk.

condition_on_previous_chunksboolean

Use previous audio as context for voice consistency.

early_stop_thresholdnumber

Early stopping threshold for batch processing.

featuresstring[]

Optional request-scoped TTS feature flags forwarded verbatim to the inference backend. Use ["quality-guard"] to enable the quality guard for this synthesis request. Feature availability is determined by the inference backend.

Example request

{
  "language": "en"
}

Response

Request fulfilled, document follows

Changes

    • breaking

      added the new required request property (media type: application/json)

    • breaking

      added the new required request property (media type: application/msgpack)

    • breaking

      the request's body type changed from no type to object (media type: application/json)

    • breaking

      the request's body type changed from no type to object (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      added the new optional request property (media type: application/json)

    • info

      added the new optional request property (media type: application/msgpack)

    • info

      the header request parameter model became optional

    • info

      added the new enum value drama-3 to the header request parameter model

    • info

      added the non-success response with the status

    • info

      removed the non-success response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status