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

# synthesize speech

> synthesize an utterance and return it as a 24 kHz mono WAV file. pass your API key as a bearer token.



## OpenAPI

````yaml /openapi.json post /v1/tts
openapi: 3.1.0
info:
  title: silk TTS API
  version: 1.0.0
  description: >-
    rumik AI's text-to-speech API. synthesize speech with the expressive `muga`
    model or the faster `mulberry` model, over HTTP or a streaming WebSocket
    session.
  contact:
    name: rumik AI
    url: https://rumik.ai
servers:
  - url: https://silk-api.rumik.ai
    description: production
security:
  - bearerAuth: []
paths:
  /v1/tts:
    post:
      tags:
        - speech
      summary: synthesize speech
      description: >-
        synthesize an utterance and return it as a 24 kHz mono WAV file. pass
        your API key as a bearer token.
      operationId: synthesizeSpeech
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TTSRequest'
            examples:
              muga:
                summary: 'muga: tone-tagged'
                value:
                  model: muga
                  text: '[happy] Namaste! Kaise hain aap?'
              mulberry:
                summary: 'mulberry: described voice'
                value:
                  model: mulberry
                  text: आज का episode थोड़ा अलग है।
                  description: >-
                    a female 30s hindi voice, smooth timbre, conversational
                    pacing, like a podcast host
              mulberry_preset:
                summary: 'mulberry: named voice'
                value:
                  model: mulberry
                  text: Hi there, how can I help you today?
                  description: >-
                    a female 30s hindi voice, smooth timbre, conversational
                    pacing, like a podcast host
                  speaker: siya
              mulberry_long:
                summary: 'mulberry: long text (raise max_new_tokens)'
                value:
                  model: mulberry
                  text: >-
                    एक बार की बात है, एक छोटे से गाँव में एक लड़की रहती थी। वो
                    रोज़ subah जल्दी उठती, खेतों तक जाती, और शाम को कहानियाँ
                    सुनाती। धीरे धीरे पूरा गाँव उसकी कहानियों का दीवाना ho gaya.
                  description: >-
                    a female 30s hindi voice, low pitch, warm timbre, slow
                    pacing, neutral, casual register, like a storyteller
                  max_new_tokens: 8192
      responses:
        '200':
          description: synthesized audio as a 24 kHz mono WAV.
          content:
            audio/wav:
              schema:
                type: string
                format: binary
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/Unavailable'
components:
  schemas:
    TTSRequest:
      type: object
      required:
        - text
      properties:
        text:
          type: string
          maxLength: 2000
          description: >-
            text to synthesize. up to 2000 characters. for `muga`, prefix with a
            tone tag, e.g. `[happy]`.
          example: '[happy] Namaste! Kaise hain aap?'
        model:
          type: string
          enum:
            - muga
            - mulberry
          default: muga
          description: >-
            which model to use. `muga` is steered by a tone tag in the text;
            `mulberry` is steered by a natural-language description.
        description:
          type: string
          description: >-
            **required for `mulberry`.** natural-language voice/style
            description. the voice is built from this. send it on every
            `mulberry` request, including when `speaker` is set. not used by
            `muga`.
          example: >-
            a female 30s hindi voice, smooth timbre, conversational pacing, like
            a podcast host
        speaker:
          type: string
          enum:
            - emma
            - mia
            - sophia
            - ava
            - ira
            - siya
            - aisha
            - zoya
            - lucas
            - noah
            - theo
            - adam
          example: siya
          description: >-
            `mulberry` only. optional named voice. `emma`, `mia`, `sophia`,
            `ava`, `ira`, `siya`, `aisha` and `zoya` are female; `lucas`,
            `noah`, `theo` and `adam` are male. case-insensitive. omit and a
            voice is generated from `description`. `description` is required
            either way.
        temperature:
          type: number
          default: 0.6
          description: sampling temperature.
        top_p:
          type: number
          default: 0.95
          description: nucleus sampling.
        top_k:
          type: integer
          default: 50
          description: top-k sampling.
        repetition_penalty:
          type: number
          default: 1.2
          description: penalize repeated tokens.
        max_new_tokens:
          type: integer
          default: 2048
          maximum: 8192
          description: >-
            output length cap. for `mulberry`, if long text comes back
            truncated, raise this above the default 2048 (up to 8192).
    Error:
      type: object
      properties:
        error:
          type: string
          description: human-readable error message.
        code:
          type: string
          description: machine-readable error code.
  responses:
    BadRequest:
      description: malformed request body or unknown model.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: bearer token missing, invalid, or expired.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: key revoked or account disabled.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    ValidationError:
      description: validation failed. check the error field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    RateLimited:
      description: rate limit hit. see the `Retry-After` header.
      headers:
        Retry-After:
          description: seconds to wait before retrying.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unavailable:
      description: upstream temporarily unavailable. retry shortly.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        your rumik API key, e.g. `rk_live_...`. create one in the rumik
        dashboard.

````