Skip to main content

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 动态获取语音列表
  • 可配置的默认设置

安装

  1. 克隆仓库:

    git clone https://github.com/Moha-Master/MiniMax-TTS-OpenAI.git
    cd MiniMax-TTS-OpenAI
    
  2. 安装依赖:

    pip install -r requirements.txt
    
  3. 通过复制 settings.yaml.examplesettings.yaml 并使用您的 MiniMax API 凭据和其他设置进行编辑来配置服务。

  4. 运行服务:

    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.examplesettings.yaml 文件,包含您的 MiniMax API 凭据和其他设置。服务会从 ~/.config/minimax-tts-openai/ 或设置的 --dir 中读取 settings.yaml

如果指定的目录中没有 settings.yaml 文件,程序会提示您需要从 settings.yaml.example 复制并编辑配置文件。

配置选项:

  • minimax.group_id: 您的 MiniMax 组 ID
  • minimax.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

minimax_tts_openai-0.0.2.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

minimax_tts_openai-0.0.2-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file minimax_tts_openai-0.0.2.tar.gz.

File metadata

  • Download URL: minimax_tts_openai-0.0.2.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for minimax_tts_openai-0.0.2.tar.gz
Algorithm Hash digest
SHA256 14b3176ca282a444aa4b8e7dff15a2fa1321678d95d04f23b1e1c5eb45bc413f
MD5 dc6ca3fdbbc186f145c1febc5d3e7f30
BLAKE2b-256 c3699f5554330787c65a998984a7faab9536fc25d4ee5b3384450a58e342c96f

See more details on using hashes here.

File details

Details for the file minimax_tts_openai-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for minimax_tts_openai-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2d8fdf1d0705ea26aab8c90f1582e28396c4164b06a9f171f61db27bb9b2f365
MD5 aea3fd66fc2974072b065b3a9c324a6f
BLAKE2b-256 7094e4aaac2e19ac87432a1b97cd88fe337be6374471ab4cb305626ea7e1e0e6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page