Support Xiaomi MiMo `mimo-v2-tts` on OpenAI-compatible `/v1/audio/speech`
Read This First (Do Not Remove This Section)
- Docs: https://docs.newapi.ai/
- Usage questions first: https://deepwiki.com/QuantumNous/new-api
- Warning: issues with this template removed, section headings deleted, or content cleared may be closed directly. Repeated abusive submissions may result in a block.
Your current newapi version 0.11.5
Submission Checks
- I have confirmed there are no similar issues
- I have thoroughly read the docs at https://docs.newapi.ai/ and the project README, and confirmed the current version cannot meet my needs
- I have not removed any guidance or section headings from this template and will complete it as requested
- I understand that maintainers have limited time and issues that do not follow this template may be ignored or closed directly
Feature Description
Add compatibility support for Xiaomi MiMo mimo-v2-tts in the OpenAI-compatible /v1/audio/speech endpoint by internally bridging to /v1/chat/completions.
Use Case
Allow OpenAI-compatible clients (e.g., Open WebUI) that rely on /v1/audio/speech to use MiMo TTS models without modifying client-side code.
Background
Some clients, such as Open WebUI, are fixed to the OpenAI-compatible /v1/audio/speech API for TTS.
However, Xiaomi MiMo mimo-v2-tts only provides TTS through /v1/chat/completions with an audio field, so it cannot be used directly through the current OpenAI audio relay path.
Problem
Even if a channel uses https://api.xiaomimimo.com and the upstream model is mimo-v2-tts, the current /v1/audio/speech relay path still forwards to upstream /v1/audio/speech, which MiMo does not support.
As a result, OpenAI-compatible TTS clients cannot use MiMo TTS through new-api.
Proposed solution
Add a MiMo-specific compatibility bridge in the OpenAI audio relay path:
- detect upstream model
mimo-v2-tts - rewrite upstream request URL from
/v1/audio/speechto/v1/chat/completions - convert OpenAI audio speech requests into MiMo chat+audio payload
- use
api-keyauthentication for MiMo - decode the audio payload from the MiMo chat response and return a normal audio response to the client
Scope / compatibility
- only enabled when upstream model is
mimo-v2-tts - existing OpenAI TTS behavior remains unchanged
- existing non-MiMo channels are unaffected
- streaming
/v1/audio/speechcompatibility is not included
Notes
MiMo TTS appears to expect the target synthesis text in the assistant message content, while the user message can be used as an optional instruction/prompt for style guidance. The compatibility layer can adapt this automatically for OpenAI-style TTS callers.
If this direction is acceptable, I can open a PR with implementation and tests.
Source: QuantumNous/new-api