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. 通过复制 config.yaml.exampleconfig.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: 工作目录,从中读取 config.yaml(默认:~/.config/minimax-tts-openai/)
  • --host: 绑定的主机地址(默认:127.0.0.1)
  • --port: 绑定的端口(默认:8000)

配置

在希望的工作目录中创建一个基于 config.yaml.exampleconfig.yaml 文件,包含您的 MiniMax API 凭据和其他设置。服务会从 ~/.config/minimax-tts-openai/ 或设置的 --dir 中读取 config.yaml

如果指定的目录中没有 config.yaml 文件,程序会提示您需要从 config.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.4.tar.gz (8.2 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.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minimax_tts_openai-0.0.4.tar.gz
  • Upload date:
  • Size: 8.2 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.4.tar.gz
Algorithm Hash digest
SHA256 66a1b0ffcabd1cd637799a75119d42a631c408eaa3a1474d7afcdbe8fc15830e
MD5 aac5385c75c89e0c6d4c1aee70e7084d
BLAKE2b-256 d7f6dd9bb88f310d0865d5c788a4e1987c9b5914546c4b267020d8db3b1a9b35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for minimax_tts_openai-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d863b7c102b36144ec6c89fecae621e52e0a4b3038650459ac676938d9f66c80
MD5 f8cd4adbc7a626189233b72b313b9eee
BLAKE2b-256 0126b19c308e628820a91991f5864482675d859309d89331fb48b25c39588469

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