# TTSFM - Text-to-Speech API Client
> **Language / 语言**: [English](README.md) | [中文](README.zh.md)
[](https://hub.docker.com/r/dbcccc/ttsfm)
[](https://github.com/dbccccccc/ttsfm)
[](https://opensource.org/licenses/MIT)

## Star History
[](https://www.star-history.com/#dbccccccc/ttsfm&Date)
## Overview
TTSFM is a free, OpenAI-compatible text-to-speech stack powered by the openai.fm backend. It ships with Python clients, a REST API, and a web playground.
## Installation
### Python package
```bash
pip install ttsfm # core client
pip install ttsfm[web] # client + Flask web app
```
### Docker image
```bash
docker run -p 8000:8000 dbcccc/ttsfm:latest
```
The container exposes the web playground at `http://localhost:8000` and an OpenAI-style endpoint at `/v1/audio/speech`.
## Quick start
### Python client
```python
from ttsfm import TTSClient, AudioFormat, Voice
client = TTSClient()
response = client.generate_speech(
text="Hello from TTSFM!",
voice=Voice.ALLOY,
response_format=AudioFormat.MP3,
)
response.save_to_file("hello") # -> hello.mp3
```
### CLI
```bash
ttsfm "Hello, world" --voice nova --format mp3 --output hello.mp3
```
### REST API
```bash
curl -X POST http://localhost:8000/v1/audio/speech -H "Content-Type: application/json" -d '{"model":"gpt-4o-mini-tts","input":"Hello world!","voice":"alloy"}' --output speech.mp3
```
## Learn more
- Browse the full API reference and operational notes in the [web documentation](http://localhost:8000/docs) (or see `ttsfm-web/templates/docs.html`).
- Read the [architecture overview](docs/architecture.md) for component diagrams.
- Contributions are welcome—see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
TTSFM is released under the [MIT License](LICENSE).
Raw data
{
"_id": null,
"home_page": null,
"name": "ttsfm",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": "dbcccc <120614547+dbccccccc@users.noreply.github.com>",
"keywords": "tts, text-to-speech, speech-synthesis, openai, api-client, audio, voice, speech",
"author": null,
"author_email": "dbcccc <120614547+dbccccccc@users.noreply.github.com>",
"download_url": "https://files.pythonhosted.org/packages/cd/f4/e491dd43a2eeae04817518b729ae176393cbea91cc1836822841718a3e97/ttsfm-3.3.7.tar.gz",
"platform": null,
"description": "# TTSFM - Text-to-Speech API Client\n\n> **Language / \u8bed\u8a00**: [English](README.md) | [\u4e2d\u6587](README.zh.md)\n\n[](https://hub.docker.com/r/dbcccc/ttsfm)\n[](https://github.com/dbccccccc/ttsfm)\n[](https://opensource.org/licenses/MIT)\n\n\n## Star History\n\n[](https://www.star-history.com/#dbccccccc/ttsfm&Date)\n\n## Overview\n\nTTSFM is a free, OpenAI-compatible text-to-speech stack powered by the openai.fm backend. It ships with Python clients, a REST API, and a web playground.\n\n## Installation\n\n### Python package\n\n```bash\npip install ttsfm # core client\npip install ttsfm[web] # client + Flask web app\n```\n\n### Docker image\n\n```bash\ndocker run -p 8000:8000 dbcccc/ttsfm:latest\n```\n\nThe container exposes the web playground at `http://localhost:8000` and an OpenAI-style endpoint at `/v1/audio/speech`.\n\n## Quick start\n\n### Python client\n\n```python\nfrom ttsfm import TTSClient, AudioFormat, Voice\n\nclient = TTSClient()\nresponse = client.generate_speech(\n text=\"Hello from TTSFM!\",\n voice=Voice.ALLOY,\n response_format=AudioFormat.MP3,\n)\nresponse.save_to_file(\"hello\") # -> hello.mp3\n```\n\n### CLI\n\n```bash\nttsfm \"Hello, world\" --voice nova --format mp3 --output hello.mp3\n```\n\n### REST API\n\n```bash\ncurl -X POST http://localhost:8000/v1/audio/speech -H \"Content-Type: application/json\" -d '{\"model\":\"gpt-4o-mini-tts\",\"input\":\"Hello world!\",\"voice\":\"alloy\"}' --output speech.mp3\n```\n\n## Learn more\n\n- Browse the full API reference and operational notes in the [web documentation](http://localhost:8000/docs) (or see `ttsfm-web/templates/docs.html`).\n- Read the [architecture overview](docs/architecture.md) for component diagrams.\n- Contributions are welcome\u2014see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n## License\n\nTTSFM is released under the [MIT License](LICENSE).\n",
"bugtrack_url": null,
"license": null,
"summary": "Text-to-Speech API Client with OpenAI compatibility",
"version": "3.3.7",
"project_urls": {
"Bug Tracker": "https://github.com/dbccccccc/ttsfm/issues",
"Documentation": "https://github.com/dbccccccc/ttsfm/blob/main/docs/",
"Homepage": "https://github.com/dbccccccc/ttsfm",
"Repository": "https://github.com/dbccccccc/ttsfm"
},
"split_keywords": [
"tts",
" text-to-speech",
" speech-synthesis",
" openai",
" api-client",
" audio",
" voice",
" speech"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "2905b43101a36954257aaa3dd1b8474ac2e28ed27e1ab92a7450e8a3b07e7590",
"md5": "c823c8ea83cbe45822b0ccbbf317c3d7",
"sha256": "1cb2df659e6d8477912ce252c532ffdceb985f0eea222674733782db6fd7d199"
},
"downloads": -1,
"filename": "ttsfm-3.3.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c823c8ea83cbe45822b0ccbbf317c3d7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 31076,
"upload_time": "2025-10-21T03:12:56",
"upload_time_iso_8601": "2025-10-21T03:12:56.241079Z",
"url": "https://files.pythonhosted.org/packages/29/05/b43101a36954257aaa3dd1b8474ac2e28ed27e1ab92a7450e8a3b07e7590/ttsfm-3.3.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "cdf4e491dd43a2eeae04817518b729ae176393cbea91cc1836822841718a3e97",
"md5": "b1d9c81a7690072d3bccde9105594e7a",
"sha256": "aec609f718a6a46832acea1319c3bd8f1f5a0ccf04037d3d4f79a136fb10c3d4"
},
"downloads": -1,
"filename": "ttsfm-3.3.7.tar.gz",
"has_sig": false,
"md5_digest": "b1d9c81a7690072d3bccde9105594e7a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 277248,
"upload_time": "2025-10-21T03:12:57",
"upload_time_iso_8601": "2025-10-21T03:12:57.920881Z",
"url": "https://files.pythonhosted.org/packages/cd/f4/e491dd43a2eeae04817518b729ae176393cbea91cc1836822841718a3e97/ttsfm-3.3.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-10-21 03:12:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dbccccccc",
"github_project": "ttsfm",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "requests",
"specs": [
[
">=",
"2.25.0"
]
]
},
{
"name": "aiohttp",
"specs": [
[
">=",
"3.8.0"
]
]
},
{
"name": "python-dotenv",
"specs": [
[
">=",
"1.0.1"
]
]
}
],
"lcname": "ttsfm"
}