Files
ChatTTS/examples/api
github-actions[bot] 4090ff2665 chore(format): run black on dev (#915)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-14 12:34:46 +09:00
..
2024-07-06 00:39:47 +09:00
2025-01-07 21:20:00 +09:00
2025-03-14 12:32:50 +09:00

Generating voice with ChatTTS via API

Install requirements

Install FastAPI and requests:

pip install -r examples/api/requirements.txt

Run API server

fastapi dev examples/api/main.py --host 0.0.0.0 --port 8000

Run openAI_API server

fastapi dev examples/api/openai_api.py --host 0.0.0.0 --port 8000

Generate audio using requests

python examples/api/client.py

mp3 audio files will be saved to the output directory.