v1

latestOpenAPI 3.1.02026-07-1312416.2 KB

Sse Generator

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.

post/sse/speak/{lang_code}

Path parameters

lang_codestring required

Query parameters

api_keystring nullable
jwt_tokenstring nullable

Headers

X-API-KEYstring nullable
authorizationstring nullable

Request body

{"stackTrail":"paths:/sse/speak/{lang_code}:post:requestBody:content:application/json:schema","oasType":"schema","type":"unknown","title":"Request Data"}

Response

Successful Response

{"stackTrail":"paths:/sse/speak/{lang_code}:post:responses:200:content:application/json:schema","oasType":"schema","type":"unknown"}