---
title: "Sse Generator"
method: POST
path: "/sse/speak/{lang_code}"
---

# Sse Generator

`POST /sse/speak/{lang_code}`

Handles the `/sse/speak/{lang_code}` POST endpoint for generating speech using Server-Sent Events (SSE).

This endpoint enables real-time streaming of text-to-speech (TTS) responses in the specified language.
The generated speech is sent as a continuous stream to the client using SSE.

Args:
    lang_code (str): The unique identifier for the language in which speech will be generated.
    request_data (dict): The body of the request containing the input text and additional configuration for TTS.

Returns:
    StreamingResponse: A Server-Sent Events (SSE) stream that transmits the generated speech in real-time.

Raises:
    HTTPException: Raised if there is an issue with the input data, language code, or TTS generation process.
    Exception: Logs and raises any unexpected errors encountered during the operation.

## Path parameters

- `lang_code` string, required

## Query parameters

- `api_key` string, nullable
- `jwt_token` string, nullable

## Headers

- `X-API-KEY` string, nullable
- `authorization` string, nullable

## Request body

- unknown

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.dev/neuphonic/apis/fastapi.md) · [All operations](https://skmtc.dev/neuphonic/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/neuphonic/fastapi/revisions/137e07c33577/schema)
