A proxy service converts Minimax TTS API to OpenAI-compatible format
Project description
MiniMax TTS 到 OpenAI API 代理
这个项目提供了一个代理服务,将 MiniMax TTS API 转换为与 OpenAI 兼容的格式,使您能够将 MiniMax 的文本转语音功能与为 OpenAI API 设计的工具和库一起使用。
特性
- OpenAI 兼容的 TTS API 端点
- 支持多种语音和模型
- 流式和非流式音频响应
- API 密钥认证
- 从 MiniMax API 动态获取语音列表
- 可配置的默认设置
安装
-
克隆仓库:
git clone https://github.com/Moha-Master/MiniMax-TTS-OpenAI.git cd MiniMax-TTS-OpenAI
-
安装依赖:
pip install -r requirements.txt
-
通过复制
settings.yaml.example到settings.yaml并使用您的 MiniMax API 凭据和其他设置进行编辑来配置服务。 -
运行服务:
uvicorn minimax_tts_openai.app:app --host 0.0.0.0 --port 8000
作为 pip 包安装
您也可以将此项目作为 pip 包安装:
pip install -e .
安装后,您可以使用以下命令运行服务:
minimax-tts-openai --dir /path/to/config --host 0.0.0.0 --port 8000
参数说明:
--dir: 工作目录,从中读取 settings.yaml(默认:~/.config/minimax-tts-openai/)--host: 绑定的主机地址(默认:127.0.0.1)--port: 绑定的端口(默认:8000)
配置
在希望的工作目录中创建一个基于 settings.yaml.example 的 settings.yaml 文件,包含您的 MiniMax API 凭据和其他设置。服务会从 ~/.config/minimax-tts-openai/ 或设置的 --dir 中读取 settings.yaml。
如果指定的目录中没有 settings.yaml 文件,程序会提示您需要从 settings.yaml.example 复制并编辑配置文件。
配置选项:
minimax.group_id: 您的 MiniMax 组 IDminimax.api_key: 您的 MiniMax API 密钥api_keys: 用于认证的 API 密钥列表defaults: 默认参数值(语音、模型、速度等)audio: 音频设置(采样率、比特率、声道)voice_fetching: 音色获取配置(voice_type 参数)supported: 支持的格式和模型
语音列表在启动时从 MiniMax API 自动获取。
API 端点
POST /v1/audio/speech: 从文本生成语音(OpenAI 兼容)GET /v1/audio/voices: 列出可用的语音GET /v1/audio/models: 列出可用的模型
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file minimax_tts_openai-0.0.1.tar.gz.
File metadata
- Download URL: minimax_tts_openai-0.0.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65ec155d3c3f2e7d73f0f2464890969fe073884939d8ae9acc429f923e7a7ffe
|
|
| MD5 |
62dd4bd534c3673981bca7425c359410
|
|
| BLAKE2b-256 |
931d9f8a86d2652d0554a7f01496a1089548fc6b70d2170bbbd592058bbc6fea
|
File details
Details for the file minimax_tts_openai-0.0.1-py3-none-any.whl.
File metadata
- Download URL: minimax_tts_openai-0.0.1-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fe1aabe7bd43b613532a62d3d9bd6944fe9a72cd1923c57edc71c54fe097d0d
|
|
| MD5 |
d2860feba1b478fb787773a7457e3aff
|
|
| BLAKE2b-256 |
e69ba5642cbf83b39eec05e9d9aec9b56e7956cb260dd9d6b3184fa393fbd7ac
|