> ## 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 ASR

> Transcribe audio with Fish Audio speech-to-text, with an optional language hint and per-segment timestamps.

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="thirdparty" provider="Fish Audio" />


## OpenAPI

````yaml POST /v1/stt/fish/asr:default
openapi: 3.0.3
info:
  title: SLNG Gateway API - Fish Audio STT
  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 ASR
    description: Fish Audio speech-to-text with optional language hints and timestamps.
paths:
  /v1/stt/fish/asr:default:
    post:
      tags:
        - Fish Audio ASR
      summary: Fish Audio ASR
      description: >-
        Transcribe audio with Fish Audio speech-to-text, with an optional
        language hint and per-segment timestamps.
      operationId: fish/asr:default
      parameters:
        - $ref: '#/components/parameters/XWorldPartFish'
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/FishAsrRequest'
            examples:
              binary:
                summary: English audio transcription
                value:
                  audio: <binary>
                  language: en
                  ignore_timestamps: true
          application/msgpack:
            schema:
              $ref: '#/components/schemas/FishAsrRequest'
            examples:
              msgpack:
                summary: MessagePack-encoded request with inline audio bytes
                value:
                  audio: <binary>
                  language: en
                  ignore_timestamps: true
      responses:
        '200':
          $ref: '#/components/responses/FishAsrSuccess'
        '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:
          - eu
  schemas:
    FishAsrRequest:
      type: object
      required:
        - audio
      properties:
        audio:
          type: string
          format: binary
          description: >-
            Audio file to transcribe (multipart) or inline audio bytes
            (MessagePack).
        language:
          type: string
          nullable: true
          description: >-
            Optional language hint (ISO code). Fish Audio still auto-detects the
            language when omitted.
        ignore_timestamps:
          type: boolean
          default: true
          description: >-
            Whether to omit precise per-segment timestamps to reduce latency for
            short audio.
    FishAsrResponse:
      type: object
      description: Fish Audio ASR response.
      required:
        - text
        - duration
        - segments
      properties:
        text:
          type: string
          description: Transcribed text.
        duration:
          type: number
          description: Duration of the audio in seconds.
        segments:
          type: array
          description: Per-segment transcription with timestamps.
          items:
            $ref: '#/components/schemas/FishAsrSegment'
        language_code:
          type: string
          nullable: true
          description: Detected ISO 639-1 language code.
        language:
          type: string
          nullable: true
          description: Detected language display name.
    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., "Validation error", "STT service
            error").
          example: STT 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 ASR error: 400 Bad Request - Invalid audio format'
      required:
        - error
    FishAsrSegment:
      type: object
      required:
        - text
        - start
        - end
      properties:
        text:
          type: string
          description: Segment text.
        start:
          type: number
          description: Segment start time in seconds.
        end:
          type: number
          description: Segment end time in seconds.
  responses:
    FishAsrSuccess:
      description: Transcription successful.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/FishAsrResponse'
          examples:
            basic:
              summary: Basic transcription
              value:
                text: Hello from Fish Audio.
                duration: 1.25
                segments:
                  - text: Hello from Fish Audio.
                    start: 0
                    end: 1.25
                language_code: en
                language: English
    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: audio'
    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: Audio 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>`.

````