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

# Fish Audio TTS S2.1 Pro

> Synthesize speech with Fish Speech S2.1 Pro over one-shot HTTP. Returns binary audio in the requested format. MessagePack requests may include inline reference audio for voice cloning.

3rd Party API Hosted by Fish Audio

For SLNG Sovereign Hosting in any of our 11 regions
[contact us](mailto:support@slng.ai).


## OpenAPI

````yaml POST /v1/tts/fish/tts:s2.1-pro
openapi: 3.0.3
info:
  title: SLNG Gateway API - Fish Audio 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: Fish Audio TTS S2 Pro
    description: Fish Audio TTS S2 Pro over one-shot HTTP and MessagePack WebSocket.
  - name: Fish Audio TTS S2.1 Pro
    description: Fish Audio TTS S2.1 Pro over one-shot HTTP and MessagePack WebSocket.
  - name: Fish Audio TTS Stream
    description: >-
      Fish Audio HTTP streaming TTS with SSE audio chunks and timestamp
      alignments.
paths:
  /v1/tts/fish/tts:s2.1-pro:
    post:
      tags:
        - Fish Audio TTS S2.1 Pro
      summary: Fish Audio TTS S2.1 Pro
      description: >-
        Synthesize speech with Fish Speech S2.1 Pro over one-shot HTTP. Returns
        binary audio in the requested format. MessagePack requests may include
        inline reference audio for voice cloning.
      operationId: fish/tts:s2.1-pro
      parameters:
        - $ref: '#/components/parameters/XWorldPartFish'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/FishTtsRequest'
            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/FishTtsRequest'
            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/FishTtsSynthesisSuccess'
        '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:
    XWorldPartFish:
      name: X-World-Part-Override
      in: header
      required: false
      description: Target world part override. Auto-selected if not provided.
      schema:
        type: string
        enum:
          - us
  schemas:
    FishTtsRequest:
      type: object
      description: Fish Audio TTS request. Shared by one-shot and streaming synthesis.
      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/FishTtsReference'
        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
    FishTtsReference:
      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 parameters, unsupported media types, or
        payloads that exceed limits.
      properties:
        error:
          type: string
          description: >-
            Error type or category (e.g., "TTS service error", "Validation
            error").
          example: TTS service error
        upstream_status:
          type: integer
          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.
          example: 'Fish Audio TTS error: 400 Bad Request - Invalid reference_id'
      required:
        - error
  responses:
    FishTtsSynthesisSuccess:
      description: >-
        Synthesis successful. Returns binary audio in the format requested via
        `format`.
      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>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.