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.3.tar.gz (8.3 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.3-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minimax_tts_openai-0.0.3.tar.gz
  • Upload date:
  • Size: 8.3 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.3.tar.gz
Algorithm Hash digest
SHA256 04a91bfd4ab99c6fa3b239723e45ca18203db31a8327cb9edf93c04bc02410cd
MD5 1ffa2816b974c33e0bb9a568a616f6e7
BLAKE2b-256 410209b0b28d9925fb9c2644a268d8e8c093a6ddb48cfd804ac60afa58fbfc5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minimax_tts_openai-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 7de58f8b7947952e7ac75d394867b036d14b756f8217264a4e5a0e256dcdac78
MD5 7e4726312baada4f21845139dcac5727
BLAKE2b-256 e07847874ee1a4d8c5a2b977e47712b94d03951d38b34109de7a674ce45af1c6

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