{"library":"pyht","title":"PlayHT Python Library","description":"The official Python client for PlayHT's text-to-speech API. Current version 0.1.14, supports Python 3.8+. The library provides async and sync clients, WebSocket streaming, and support for PlayHT 2.0 and HD voices. Release cadence is irregular.","language":"python","status":"active","last_verified":"Fri May 01","install":{"commands":["pip install pyht"],"cli":null},"imports":["from pyht import Client","from pyht import TTSOptions","from pyht import Format"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nfrom pyht import Client, TTSOptions, Format\n\nclient = Client(\n    user_id=os.environ.get('PLAYHT_USER_ID', ''),\n    api_key=os.environ.get('PLAYHT_API_KEY', ''),\n)\noptions = TTSOptions(\n    voice='s3://voice-cloning-zero-shot/xxxxx',\n    format=Format.FORMAT_MP3,\n    sample_rate=24000,\n)\nwith client.tts(text=\"Hello, world!\", options=options) as audio_stream:\n    with open('output.mp3', 'wb') as f:\n        for chunk in audio_stream:\n            f.write(chunk)","lang":"python","description":"Initialize a client, create TTS options, and stream audio to a file.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}