from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.speech.speak(text="Hello, welcome to our text-to-speech service.", language="en")
# Handle response
print(res)"(binary)"Convert text to speech with automatic language detection.
Request Body:
text: Input text to convert to speech - requiredlanguage: Language code (default: “auto”) - “auto” for automatic detection, or ISO 639-1 codes: en, zh, hi, es, ar, bn, pt, ru, ja, pa, de, ko, fr, tr, it, th, pl, nl, id, vi, urResponse: Returns audio file in WAV format with X-Language-Code header
from mka1 import SDK
with SDK(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
) as sdk:
res = sdk.llm.speech.speak(text="Hello, welcome to our text-to-speech service.", language="en")
# Handle response
print(res)"(binary)"Gateway auth: send Authorization: Bearer <mka1-api-key>. For multi-user server-side integrations, you can also send X-On-Behalf-Of: <external-user-id>.
Request parameters for text-to-speech conversion with language selection.
Audio file in WAV format with language code header
The response is of type file.
Was this page helpful?