> ## 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 TTS 2.1 Pro

> Synthesize speech with SLNG-hosted Fish TTS 2.1 Pro in a single HTTP request. The response is binary audio in the format set by `format` (MP3 by default).

Send `application/json` to synthesize with a saved voice via `reference_id`, or `application/msgpack` to clone a voice from inline reference audio supplied in `references`. For incremental, low-latency synthesis, connect to the WebSocket channel at the same path instead.


export const HostingBanner = ({type = "slng", provider, regions = []}) => {
  const isSlng = type === "slng";
  const regionLabel = regions.map(r => r.toUpperCase()).join(", ");
  return <div className={`hosting-banner ${isSlng ? "hosting-banner--slng" : "hosting-banner--thirdparty"}`}>
      <span className="hosting-banner__label">
        {isSlng ? "SLNG Sovereign Hosting" : `3rd Party API Hosted by ${provider}`}
      </span>
      <span className="hosting-banner__text">
        {isSlng ? <>
            On demand in: {regionLabel}.{" "}
            <a href="mailto:support@slng.ai">Request here</a> if you want access
            in any other of our 11 regions.
          </> : <>
            For SLNG Sovereign Hosting in any of our 11 regions{" "}
            <a href="mailto:support@slng.ai">contact us</a>.
          </>}
      </span>
    </div>;
};

<HostingBanner type="slng" regions={["AU","EU"]} />


## OpenAPI

````yaml POST /v1/tts/slng/fish/tts:s2.1-pro
openapi: 3.0.3
info:
  title: SLNG Gateway API - SLNG TTS
  version: 0.1.0
  description: Unified API for speech-to-text and text-to-speech services.
  contact:
    name: SLNG Support
    email: support@slng.ai
servers:
  - url: https://api.slng.ai
    description: Production
  - url: https://stageapi.slng.ai
    description: Staging
security:
  - BearerAuth: []
tags:
  - name: Deepgram Aura 2
    description: Deepgram Aura 2 for conversational voice agents.
  - name: Orpheus English
    description: Orpheus TTS with emotion control.
  - name: Rime Arcana v2
    description: Rime Arcana v2 TTS with multi-language support.
  - name: Rime Arcana v3
    description: Rime Arcana v3 TTS with multilingual support (English, Hindi).
  - name: Rime Coda
    description: Rime Coda TTS for Bahasa Indonesian.
  - name: Inworld Max 1.5
    description: Inworld Max 1.5 for multilingual, expressive synthesis.
  - name: Fish TTS 2.1 Pro
    description: >-
      SLNG-hosted Fish TTS 2.1 Pro over one-shot HTTP and native MessagePack
      WebSocket.
paths:
  /v1/tts/slng/fish/tts:s2.1-pro:
    post:
      tags:
        - Fish TTS 2.1 Pro
      summary: Fish TTS 2.1 Pro
      description: >
        Synthesize speech with SLNG-hosted Fish TTS 2.1 Pro in a single HTTP
        request. The response is binary audio in the format set by `format` (MP3
        by default).


        Send `application/json` to synthesize with a saved voice via
        `reference_id`, or `application/msgpack` to clone a voice from inline
        reference audio supplied in `references`. For incremental, low-latency
        synthesis, connect to the WebSocket channel at the same path instead.
      operationId: slng/fish/tts:s2.1-pro
      parameters:
        - $ref: '#/components/parameters/XWorldPartSlngFish'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SlngFishTtsRequest'
            examples:
              basic:
                summary: Basic synthesis
                value:
                  text: Hello from Fish Audio S2.1 Pro.
                  reference_id: 9a9cf47702da476aa4629e2506d4a857
                  format: mp3
          application/msgpack:
            schema:
              $ref: '#/components/schemas/SlngFishTtsRequest'
            examples:
              cloning:
                summary: Synthesis with inline reference audio (MessagePack only)
                value:
                  text: Hello from Fish Audio S2.1 Pro.
                  format: mp3
      responses:
        '200':
          $ref: '#/components/responses/TtsSynthesisSuccess'
        '400':
          $ref: '#/components/responses/ProviderBadRequest'
        '401':
          $ref: '#/components/responses/ProviderUnauthorized'
        '402':
          $ref: '#/components/responses/ProviderPaymentRequired'
        '413':
          $ref: '#/components/responses/ProviderPayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '503':
          $ref: '#/components/responses/ProviderServiceUnavailable'
components:
  parameters:
    XWorldPartSlngFish:
      name: X-World-Part-Override
      in: header
      required: false
      description: Target world part override. Auto-selected if not provided.
      schema:
        type: string
        enum:
          - au
          - eu
  schemas:
    SlngFishTtsRequest:
      type: object
      description: >-
        Request body for SLNG-hosted Fish TTS 2.1 Pro synthesis. Shared by the
        `application/json` and `application/msgpack` content types; only
        MessagePack can carry inline reference audio in `references`.
      required:
        - text
      properties:
        text:
          type: string
          minLength: 1
          description: >-
            Text to synthesize. S2-family variants support multi-speaker
            dialogue markers.
        reference_id:
          type: string
          description: >-
            Fish Audio voice-model ID. For multi-speaker synthesis, provide one
            ID per speaker as an array.
        references:
          type: array
          description: >-
            Inline reference audio for voice cloning. MessagePack-only, as the
            entries carry binary audio.
          items:
            $ref: '#/components/schemas/SlngFishTtsReference'
        prosody:
          type: object
          description: Prosody controls.
          properties:
            speed:
              type: number
              minimum: 0.5
              maximum: 2
              default: 1
              description: Speech speed multiplier.
            volume:
              type: number
              minimum: -20
              maximum: 20
              default: 0
              description: Volume adjustment in dB.
            normalize_loudness:
              type: boolean
              default: true
              description: Whether to normalize output loudness.
        temperature:
          type: number
          minimum: 0
          maximum: 1
          default: 0.7
          description: Sampling temperature.
        top_p:
          type: number
          minimum: 0
          maximum: 1
          default: 0.7
          description: Nucleus sampling probability mass.
        chunk_length:
          type: integer
          minimum: 100
          maximum: 300
          default: 300
          description: Target chunk length for synthesis.
        normalize:
          type: boolean
          default: true
          description: Whether to normalize input text before synthesis.
        format:
          type: string
          enum:
            - wav
            - pcm
            - mp3
            - opus
          default: mp3
          description: Output audio format.
        sample_rate:
          type: integer
          nullable: true
          enum:
            - 8000
            - 16000
            - 24000
            - 32000
            - 44100
            - 48000
          description: >-
            Output sample rate in Hz. Defaults to the provider default for the
            chosen format when omitted.
        mp3_bitrate:
          type: integer
          enum:
            - 64
            - 128
            - 192
          default: 128
          description: MP3 bitrate in kbps (used when `format` is `mp3`).
        opus_bitrate:
          type: integer
          enum:
            - -1000
            - 24000
            - 32000
            - 48000
            - 64000
          default: -1000
          description: >-
            Opus bitrate in bps (used when `format` is `opus`). `-1000` selects
            the provider default.
        latency:
          type: string
          enum:
            - low
            - normal
            - balanced
          default: normal
          description: Latency/quality trade-off.
        max_new_tokens:
          type: integer
          default: 1024
          description: Maximum number of new tokens to generate.
        repetition_penalty:
          type: number
          default: 1.2
          description: Penalty applied to repeated tokens.
        min_chunk_length:
          type: integer
          minimum: 0
          maximum: 100
          default: 50
          description: Minimum chunk length for synthesis.
        condition_on_previous_chunks:
          type: boolean
          default: true
          description: Whether generation is conditioned on previously generated chunks.
        early_stop_threshold:
          type: number
          minimum: 0
          maximum: 1
          default: 1
          description: Early-stop threshold for generation.
        features:
          type: array
          description: Optional feature flags.
          items:
            type: string
    SlngFishTtsReference:
      type: object
      description: >-
        Inline reference audio for voice cloning. Supplied only over
        `application/msgpack`.
      required:
        - audio
        - text
      properties:
        audio:
          type: string
          format: binary
          description: Reference audio bytes (MessagePack binary value).
        text:
          type: string
          description: Transcript of the reference audio.
    AudioBinary:
      type: string
      format: binary
      description: Binary audio data.
    ProviderErrorResponse:
      type: object
      description: >
        Provider error response. Contains error information from the upstream
        provider.

        Common errors include invalid speakers, unsupported languages, or
        malformed requests.
      properties:
        error:
          type: string
          description: >-
            Error type or category (e.g., "TTS service error", "Validation
            error").
          example: TTS service error
        status:
          type: number
          description: >-
            Original HTTP status code from the provider (may differ from gateway
            response code).
          example: 400
        details:
          type: string
          description: >
            Detailed error message from the provider. For TTS errors, this
            typically includes

            the specific validation failure (e.g., invalid speaker ID for the
            selected model/language).
          example: >-
            Rime TTS API error: 400 Bad Request - Invalid argument: Invalid
            speaker: aurelie
      required:
        - error
  responses:
    TtsSynthesisSuccess:
      description: Synthesis successful.
      content:
        audio/*:
          schema:
            $ref: '#/components/schemas/AudioBinary'
    ProviderBadRequest:
      description: Bad request - invalid parameters provided.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProviderErrorResponse'
          examples:
            validation-error:
              summary: Validation error
              value:
                error: Validation error
                details: 'Missing required field: text'
    ProviderUnauthorized:
      description: Invalid or missing API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProviderErrorResponse'
    ProviderPaymentRequired:
      description: Insufficient credit or payment required.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProviderErrorResponse'
    ProviderPayloadTooLarge:
      description: Request payload exceeds the provider size limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProviderErrorResponse'
    UnsupportedMediaType:
      description: Unsupported request media type.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProviderErrorResponse'
    ProviderServiceUnavailable:
      description: Service unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ProviderErrorResponse'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: |
        API key issued by SLNG. Pass as `Authorization: Bearer <token>`.

````