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

# Sse Generator

`POST /sse/speak/{lang_code}`

## Request

- Base URL: `https://api.neuphonic.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.neuphonic.com/sse/speak/{lang_code}`
- Auth: none declared

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/neuphonic-api.md) - [All operations](https://skmtc.dev/neuphonic/apis/neuphonic-api/llms.txt) - [OpenAPI document](https://skmtc.dev/neuphonic/apis/neuphonic-api/revisions/941fd29844c9?raw)
