openapi: 3.0.3
info:
  title: SLNG Gateway API - Soniox TTS
  version: 0.1.0
  description: Real-time text-to-speech with streaming WebSocket and one-shot HTTP synthesis
  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: []
paths:
  /v1/tts/soniox/tts-rt:v1:
    post:
      operationId: soniox/tts-rt:v1
      summary: Soniox TTS v1
      description: Real-time text-to-speech with streaming WebSocket and one-shot HTTP synthesis
      tags:
        - Soniox TTS v1
      requestBody:
        $ref: "#/components/requestBodies/SonioxTtsRtV1RequestBody"
      responses:
        "200":
          description: Success
        "400":
          $ref: "#/components/responses/ProviderBadRequest"
        "401":
          $ref: "#/components/responses/ProviderUnauthorized"
        "500":
          $ref: "#/components/responses/ProviderInternalServerError"
        "503":
          $ref: "#/components/responses/ProviderServiceUnavailable"
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
  requestBodies:
    SonioxTtsRtV1RequestBody:
      required: true
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/SonioxTtsRtV1Request"
          examples:
            example1:
              summary: Basic English synthesis
              value:
                text: Hello from Soniox text-to-speech.
                voice: Adrian
                audio_format: wav
                sample_rate: 24000
  schemas:
    SonioxTtsRtV1Request:
      type: object
      description: Soniox real-time TTS synthesis request.
      properties:
        text:
          type: string
          minLength: 1
          maxLength: 5000
          description: Text to synthesize.
        voice:
          type: string
          description: Voice name.
          default: Adrian
        language:
          type: string
          description: ISO 639-1 language code.
          default: en
          enum:
            - af
            - sq
            - ar
            - az
            - eu
            - be
            - bn
            - bs
            - bg
            - ca
            - zh
            - hr
            - cs
            - da
            - nl
            - en
            - et
            - fi
            - fr
            - gl
            - de
            - el
            - gu
            - he
            - hi
            - hu
            - id
            - it
            - ja
            - kn
            - kk
            - ko
            - lv
            - lt
            - mk
            - ms
            - ml
            - mr
            - no
            - fa
            - pl
            - pt
            - pa
            - ro
            - ru
            - sr
            - sk
            - sl
            - es
            - sw
            - sv
            - tl
            - ta
            - te
            - th
            - tr
            - uk
            - ur
            - vi
            - cy
        audio_format:
          type: string
          description: Output audio format.
          default: wav
        sample_rate:
          type: integer
          description: Output sample rate in Hz.
          default: 24000
        bitrate:
          type: integer
          description: Codec bitrate in bps. Only applicable to lossy compressed formats.
        model:
          type: string
          description: Soniox TTS model identifier.
          default: tts-rt-v1
      required:
        - text
  responses:
    ProviderBadRequest:
      description: Bad request — invalid parameters.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    ProviderUnauthorized:
      description: Unauthorized — invalid or missing API key.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    ProviderInternalServerError:
      description: Internal server error.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
    ProviderServiceUnavailable:
      description: Service temporarily unavailable.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
