> ## Documentation Index
> Fetch the complete documentation index at: https://docs.slng.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Fish Audio TTS S2.1 Pro

> Stream speech synthesis from Fish Speech S2.1 Pro over a native MessagePack WebSocket. Send a start frame followed by text frames; receive binary audio chunks.



## AsyncAPI

````yaml api-reference/asyncapi/tts-fish.asyncapi.yaml /v1/tts/fish/tts:s2.1-pro
id: /v1/tts/fish/tts:s2.1-pro
title: Fish Audio TTS S2.1 Pro
description: >-
  Stream speech synthesis from Fish Speech S2.1 Pro over a native MessagePack
  WebSocket. Send a start frame followed by text frames; receive binary audio
  chunks.
servers:
  - id: production
    protocol: wss
    host: api.slng.ai
    bindings: []
    variables: []
  - id: staging
    protocol: wss
    host: stageapi.slng.ai
    bindings: []
    variables: []
address: /v1/tts/fish/tts:s2.1-pro
parameters: []
bindings:
  - protocol: ws
    version: latest
    value:
      method: GET
      headers:
        type: object
        properties:
          X-World-Part-Override:
            type: string
            description: >-
              Target world part override. Auto-selected if not provided.
              Available world parts: `eu`.
            enum:
              - eu
            x-parser-schema-id: <anonymous-schema-44>
        x-parser-schema-id: WebsocketHeadersFish
    schemaProperties:
      - name: method
        type: string
        description: GET
        required: false
      - name: headers
        type: object
        required: false
        properties:
          - name: X-World-Part-Override
            type: string
            description: >-
              Target world part override. Auto-selected if not provided.
              Available world parts: `eu`.
            enumValues:
              - eu
            required: false
operations:
  - &ref_1
    id: ttsFishTtsS21ProReceiveStart
    title: Tts fish tts s21 pro receive start
    description: Start a synthesis session on Fish Audio TTS S2.1 Pro
    type: receive
    messages:
      - &ref_8
        id: FishTtsStartRequest
        contentType: application/msgpack
        payload:
          - name: Start Request
            description: >-
              Open a Fish Audio synthesis session with voice and audio
              configuration.
            type: object
            properties:
              - name: event
                type: string
                description: start
                required: true
              - name: request
                type: object
                description: >-
                  Synthesis configuration for a Fish Audio WebSocket start
                  frame.
                required: true
                properties:
                  - name: text
                    type: string
                    description: >-
                      Optional priming text. May be empty in a start frame; text
                      is normally sent via subsequent text frames.
                    required: false
                  - name: reference_id
                    type: string
                    description: >-
                      Fish Audio voice-model ID. For multi-speaker synthesis,
                      provide one ID per speaker as an array.
                    required: false
                  - name: references
                    type: array
                    description: >-
                      Inline reference audio for voice cloning (MessagePack
                      binary values).
                    required: false
                    properties:
                      - name: audio
                        type: string
                        description: Reference audio bytes.
                        required: true
                      - name: text
                        type: string
                        description: Transcript of the reference audio.
                        required: true
                  - name: prosody
                    type: object
                    description: Prosody controls.
                    required: false
                    properties:
                      - name: speed
                        type: number
                        description: Speech speed multiplier.
                        required: false
                      - name: volume
                        type: number
                        description: Volume adjustment in dB.
                        required: false
                      - name: normalize_loudness
                        type: boolean
                        description: Whether to normalize output loudness.
                        required: false
                  - name: temperature
                    type: number
                    description: Sampling temperature.
                    required: false
                  - name: top_p
                    type: number
                    description: Nucleus sampling probability mass.
                    required: false
                  - name: chunk_length
                    type: integer
                    description: Target chunk length for synthesis.
                    required: false
                  - name: normalize
                    type: boolean
                    description: Whether to normalize input text before synthesis.
                    required: false
                  - name: format
                    type: string
                    description: Output audio format.
                    enumValues:
                      - wav
                      - pcm
                      - mp3
                      - opus
                    required: false
                  - name: sample_rate
                    type: integer
                    description: Output sample rate in Hz.
                    enumValues:
                      - 8000
                      - 16000
                      - 24000
                      - 32000
                      - 44100
                      - 48000
                    required: false
                  - name: mp3_bitrate
                    type: integer
                    description: MP3 bitrate in kbps.
                    enumValues:
                      - 64
                      - 128
                      - 192
                    required: false
                  - name: opus_bitrate
                    type: integer
                    description: Opus bitrate in bps. `-1000` selects the provider default.
                    enumValues:
                      - -1000
                      - 24000
                      - 32000
                      - 48000
                      - 64000
                    required: false
                  - name: latency
                    type: string
                    description: Latency/quality trade-off.
                    enumValues:
                      - low
                      - normal
                      - balanced
                    required: false
                  - name: max_new_tokens
                    type: integer
                    description: Maximum number of new tokens to generate.
                    required: false
                  - name: repetition_penalty
                    type: number
                    description: Penalty applied to repeated tokens.
                    required: false
                  - name: min_chunk_length
                    type: integer
                    description: Minimum chunk length for synthesis.
                    required: false
                  - name: condition_on_previous_chunks
                    type: boolean
                    description: >-
                      Whether generation is conditioned on previously generated
                      chunks.
                    required: false
                  - name: early_stop_threshold
                    type: number
                    description: Early-stop threshold for generation.
                    required: false
                  - name: features
                    type: array
                    description: Optional feature flags.
                    required: false
                    properties:
                      - name: item
                        type: string
                        required: false
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            MessagePack start frame. Must be the first message; opens the
            synthesis session.
          required:
            - event
            - request
          properties:
            event:
              type: string
              const: start
              x-parser-schema-id: <anonymous-schema-2>
            request:
              type: object
              description: Synthesis configuration for a Fish Audio WebSocket start frame.
              properties:
                text:
                  type: string
                  description: >-
                    Optional priming text. May be empty in a start frame; text
                    is normally sent via subsequent text frames.
                  x-parser-schema-id: <anonymous-schema-3>
                reference_id:
                  type: string
                  description: >-
                    Fish Audio voice-model ID. For multi-speaker synthesis,
                    provide one ID per speaker as an array.
                  x-parser-schema-id: <anonymous-schema-4>
                references:
                  type: array
                  description: >-
                    Inline reference audio for voice cloning (MessagePack binary
                    values).
                  items:
                    type: object
                    description: >-
                      Inline reference audio for voice cloning, carried as
                      MessagePack binary.
                    required:
                      - audio
                      - text
                    properties:
                      audio:
                        type: string
                        format: binary
                        description: Reference audio bytes.
                        x-parser-schema-id: <anonymous-schema-6>
                      text:
                        type: string
                        description: Transcript of the reference audio.
                        x-parser-schema-id: <anonymous-schema-7>
                    x-parser-schema-id: FishTtsReference
                  x-parser-schema-id: <anonymous-schema-5>
                prosody:
                  type: object
                  description: Prosody controls.
                  properties:
                    speed:
                      type: number
                      minimum: 0.5
                      maximum: 2
                      default: 1
                      description: Speech speed multiplier.
                      x-parser-schema-id: <anonymous-schema-9>
                    volume:
                      type: number
                      minimum: -20
                      maximum: 20
                      default: 0
                      description: Volume adjustment in dB.
                      x-parser-schema-id: <anonymous-schema-10>
                    normalize_loudness:
                      type: boolean
                      default: true
                      description: Whether to normalize output loudness.
                      x-parser-schema-id: <anonymous-schema-11>
                  x-parser-schema-id: <anonymous-schema-8>
                temperature:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 0.7
                  description: Sampling temperature.
                  x-parser-schema-id: <anonymous-schema-12>
                top_p:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 0.7
                  description: Nucleus sampling probability mass.
                  x-parser-schema-id: <anonymous-schema-13>
                chunk_length:
                  type: integer
                  minimum: 100
                  maximum: 300
                  default: 300
                  description: Target chunk length for synthesis.
                  x-parser-schema-id: <anonymous-schema-14>
                normalize:
                  type: boolean
                  default: true
                  description: Whether to normalize input text before synthesis.
                  x-parser-schema-id: <anonymous-schema-15>
                format:
                  type: string
                  enum:
                    - wav
                    - pcm
                    - mp3
                    - opus
                  default: mp3
                  description: Output audio format.
                  x-parser-schema-id: <anonymous-schema-16>
                sample_rate:
                  type: integer
                  nullable: true
                  enum:
                    - 8000
                    - 16000
                    - 24000
                    - 32000
                    - 44100
                    - 48000
                  description: Output sample rate in Hz.
                  x-parser-schema-id: <anonymous-schema-17>
                mp3_bitrate:
                  type: integer
                  enum:
                    - 64
                    - 128
                    - 192
                  default: 128
                  description: MP3 bitrate in kbps.
                  x-parser-schema-id: <anonymous-schema-18>
                opus_bitrate:
                  type: integer
                  enum:
                    - -1000
                    - 24000
                    - 32000
                    - 48000
                    - 64000
                  default: -1000
                  description: Opus bitrate in bps. `-1000` selects the provider default.
                  x-parser-schema-id: <anonymous-schema-19>
                latency:
                  type: string
                  enum:
                    - low
                    - normal
                    - balanced
                  default: normal
                  description: Latency/quality trade-off.
                  x-parser-schema-id: <anonymous-schema-20>
                max_new_tokens:
                  type: integer
                  default: 1024
                  description: Maximum number of new tokens to generate.
                  x-parser-schema-id: <anonymous-schema-21>
                repetition_penalty:
                  type: number
                  default: 1.2
                  description: Penalty applied to repeated tokens.
                  x-parser-schema-id: <anonymous-schema-22>
                min_chunk_length:
                  type: integer
                  minimum: 0
                  maximum: 100
                  default: 50
                  description: Minimum chunk length for synthesis.
                  x-parser-schema-id: <anonymous-schema-23>
                condition_on_previous_chunks:
                  type: boolean
                  default: true
                  description: >-
                    Whether generation is conditioned on previously generated
                    chunks.
                  x-parser-schema-id: <anonymous-schema-24>
                early_stop_threshold:
                  type: number
                  minimum: 0
                  maximum: 1
                  default: 1
                  description: Early-stop threshold for generation.
                  x-parser-schema-id: <anonymous-schema-25>
                features:
                  type: array
                  description: Optional feature flags.
                  items:
                    type: string
                    x-parser-schema-id: <anonymous-schema-27>
                  x-parser-schema-id: <anonymous-schema-26>
              x-parser-schema-id: FishTtsWsRequest
          x-parser-schema-id: <anonymous-schema-1>
        title: Start Request
        description: >-
          Open a Fish Audio synthesis session with voice and audio
          configuration.
        example: |-
          {
            "event": "start",
            "request": {
              "reference_id": "9a9cf47702da476aa4629e2506d4a857",
              "format": "mp3"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: FishTtsStartRequest
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: /v1/tts/fish/tts:s2.1-pro
  - &ref_2
    id: ttsFishTtsS21ProReceiveText
    title: Tts fish tts s21 pro receive text
    description: Send text to Fish Audio TTS S2.1 Pro
    type: receive
    messages:
      - &ref_9
        id: FishTtsTextMessage
        contentType: application/msgpack
        payload:
          - name: Text Frame
            description: Append text to synthesize on the active session.
            type: object
            properties:
              - name: event
                type: string
                description: text
                required: true
              - name: text
                type: string
                description: Text to synthesize.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: MessagePack text frame carrying text to synthesize.
          required:
            - event
            - text
          properties:
            event:
              type: string
              const: text
              x-parser-schema-id: <anonymous-schema-29>
            text:
              type: string
              minLength: 1
              description: Text to synthesize.
              x-parser-schema-id: <anonymous-schema-30>
          x-parser-schema-id: <anonymous-schema-28>
        title: Text Frame
        description: Append text to synthesize on the active session.
        example: |-
          {
            "event": "text",
            "text": "Hello from Fish Audio."
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: FishTtsTextMessage
    bindings: []
    extensions: *ref_0
  - &ref_3
    id: ttsFishTtsS21ProReceiveFlush
    title: Tts fish tts s21 pro receive flush
    description: Flush buffered text on Fish Audio TTS S2.1 Pro
    type: receive
    messages:
      - &ref_10
        id: FishTtsFlushMessage
        contentType: application/msgpack
        payload:
          - name: Flush Frame
            description: Force synthesis of buffered text without ending the session.
            type: object
            properties:
              - name: event
                type: string
                description: flush
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: MessagePack flush frame.
          required:
            - event
          properties:
            event:
              type: string
              const: flush
              x-parser-schema-id: <anonymous-schema-32>
          x-parser-schema-id: <anonymous-schema-31>
        title: Flush Frame
        description: Force synthesis of buffered text without ending the session.
        example: |-
          {
            "event": "flush"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: FishTtsFlushMessage
    bindings: []
    extensions: *ref_0
  - &ref_4
    id: ttsFishTtsS21ProReceiveStop
    title: Tts fish tts s21 pro receive stop
    description: Stop the session on Fish Audio TTS S2.1 Pro
    type: receive
    messages:
      - &ref_11
        id: FishTtsStopMessage
        contentType: application/msgpack
        payload:
          - name: Stop Frame
            description: End input; the server finishes synthesis and closes the session.
            type: object
            properties:
              - name: event
                type: string
                description: stop
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: MessagePack stop frame.
          required:
            - event
          properties:
            event:
              type: string
              const: stop
              x-parser-schema-id: <anonymous-schema-34>
          x-parser-schema-id: <anonymous-schema-33>
        title: Stop Frame
        description: End input; the server finishes synthesis and closes the session.
        example: |-
          {
            "event": "stop"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: FishTtsStopMessage
    bindings: []
    extensions: *ref_0
  - &ref_5
    id: ttsFishTtsS21ProSendAudio
    title: Tts fish tts s21 pro send audio
    description: Receive an audio chunk from Fish Audio TTS S2.1 Pro
    type: send
    messages:
      - &ref_12
        id: FishTtsAudioChunk
        contentType: application/msgpack
        payload:
          - name: Audio Chunk
            description: Streamed binary audio chunk from Fish Audio.
            type: object
            properties:
              - name: event
                type: string
                description: audio
                required: true
              - name: audio
                type: string
                description: Binary audio chunk (MessagePack binary value).
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            MessagePack audio frame carrying a binary audio chunk in the
            requested format.
          required:
            - event
            - audio
          properties:
            event:
              type: string
              const: audio
              x-parser-schema-id: <anonymous-schema-36>
            audio:
              type: string
              format: binary
              description: Binary audio chunk (MessagePack binary value).
              x-parser-schema-id: <anonymous-schema-37>
          x-parser-schema-id: <anonymous-schema-35>
        title: Audio Chunk
        description: Streamed binary audio chunk from Fish Audio.
        example: |-
          {
            "event": "audio",
            "audio": "<binary>"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: FishTtsAudioChunk
    bindings: []
    extensions: *ref_0
  - &ref_6
    id: ttsFishTtsS21ProSendFinish
    title: Tts fish tts s21 pro send finish
    description: Receive the finish signal from Fish Audio TTS S2.1 Pro
    type: send
    messages:
      - &ref_13
        id: FishTtsFinish
        contentType: application/msgpack
        payload:
          - name: Finish
            description: End-of-synthesis signal for the session.
            type: object
            properties:
              - name: event
                type: string
                description: finish
                required: true
              - name: reason
                type: string
                description: Completion reason.
                enumValues:
                  - stop
                  - error
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: >-
            MessagePack finish frame. `reason` indicates normal completion or an
            error stop.
          required:
            - event
            - reason
          properties:
            event:
              type: string
              const: finish
              x-parser-schema-id: <anonymous-schema-39>
            reason:
              type: string
              enum:
                - stop
                - error
              description: Completion reason.
              x-parser-schema-id: <anonymous-schema-40>
          x-parser-schema-id: <anonymous-schema-38>
        title: Finish
        description: End-of-synthesis signal for the session.
        example: |-
          {
            "event": "finish",
            "reason": "stop"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: FishTtsFinish
    bindings: []
    extensions: *ref_0
  - &ref_7
    id: ttsFishTtsS21ProSendError
    title: Tts fish tts s21 pro send error
    description: Receive an error from Fish Audio TTS S2.1 Pro
    type: send
    messages:
      - &ref_14
        id: FishTtsError
        contentType: application/msgpack
        payload:
          - name: Error
            description: Error frame from the provider.
            type: object
            properties:
              - name: event
                type: string
                description: error
                required: true
              - name: error
                type: string
                description: Human-readable error message.
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          description: MessagePack error frame.
          required:
            - event
            - error
          properties:
            event:
              type: string
              const: error
              x-parser-schema-id: <anonymous-schema-42>
            error:
              type: string
              minLength: 1
              description: Human-readable error message.
              x-parser-schema-id: <anonymous-schema-43>
          x-parser-schema-id: <anonymous-schema-41>
        title: Error
        description: Error frame from the provider.
        example: |-
          {
            "event": "error",
            "error": "Synthesis failed"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: FishTtsError
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_1
  - *ref_2
  - *ref_3
  - *ref_4
receiveOperations:
  - *ref_5
  - *ref_6
  - *ref_7
sendMessages:
  - *ref_8
  - *ref_9
  - *ref_10
  - *ref_11
receiveMessages:
  - *ref_12
  - *ref_13
  - *ref_14
extensions:
  - id: x-parser-unique-object-id
    value: /v1/tts/fish/tts:s2.1-pro
securitySchemes:
  - id: bearer
    name: bearer
    type: http
    description: >
      API key issued by SLNG. Pass as `Authorization: Bearer <token>` in the
      WebSocket upgrade request headers.
    scheme: bearer
    extensions: []

````