openclaw - 💡(How to fix) Fix fix(tts/xiaomi): Xiaomi Token Plan endpoint uses Bearer auth, not api-key header [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77692Fetched 2026-05-06 06:22:59
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
commented ×1mentioned ×1subscribed ×1

Root Cause

This works for the pay-as-you-go endpoint but returns 401 Invalid API Key for Token Plan users, because token-plan-cn.xiaomimimo.com only accepts standard OpenAI-compatible Authorization: Bearer auth.

Code Example

headers: {
  "api-key": apiKey,
  "Content-Type": "application/json"
}
`\

This works for the pay-as-you-go endpoint but returns **401 Invalid API Key** for Token Plan users, because `token-plan-cn.xiaomimimo.com` only accepts standard OpenAI-compatible `Authorization: Bearer` auth.

Verified with direct `curl` calls:
- `api-key` header → `token-plan-cn` → **401 Invalid API Key**
- `Authorization: Bearer``token-plan-cn` → **200 OK, audio returned**

Since the pay-as-you-go endpoint (`api.xiaomimimo.com`) also accepts `Authorization: Bearer`, switching to Bearer would be backward-compatible.

## Suggested Fix

Change the auth header from `api-key` to `Authorization: Bearer` in the Xiaomi TTS provider:
RAW_BUFFERClick to expand / collapse

`## Background

Xiaomi MiMo launched the MiMo Orbit Plan (创造者百万亿Token激励计划) on 2026-04-28 alongside the open-source release of MiMo-V2.5. Developers who apply and are approved receive a Token Plan subscription (e.g. Max Plan worth ¥659/month).

Token Plan users have different credentials and endpoint from pay-as-you-go users:

Pay-as-you-goToken Plan (Orbit)
Endpointhttps://api.xiaomimimo.com/v1https://token-plan-cn.xiaomimimo.com/v1
API Key prefixsk-tp-
Auth headerapi-key: <token>Authorization: Bearer <token>

Both endpoints accept the same /v1/chat/completions request format with audio: { voice, format } for TTS.

Problem

The bundled Xiaomi TTS provider (speech-provider-B1-Tp_iU.js) hardcodes the api-key authentication header:

headers: {
  "api-key": apiKey,
  "Content-Type": "application/json"
}
`\

This works for the pay-as-you-go endpoint but returns **401 Invalid API Key** for Token Plan users, because `token-plan-cn.xiaomimimo.com` only accepts standard OpenAI-compatible `Authorization: Bearer` auth.

Verified with direct `curl` calls:
- `api-key` header → `token-plan-cn` → **401 Invalid API Key**
- `Authorization: Bearer``token-plan-cn` → **200 OK, audio returned**

Since the pay-as-you-go endpoint (`api.xiaomimimo.com`) also accepts `Authorization: Bearer`, switching to Bearer would be backward-compatible.

## Suggested Fix

Change the auth header from `api-key` to `Authorization: Bearer` in the Xiaomi TTS provider:

```diff
 headers: {
-  "api-key": apiKey,
+  "Authorization": `Bearer ${apiKey}`,
   "Content-Type": "application/json"
 }
`\

This maintains compatibility with the pay-as-you-go endpoint while enabling Token Plan (Orbit) users to use MiMo TTS natively.

## Impact

Token Plan users are a rapidly growing segment — the Orbit plan distributed 100T tokens in 30 days to global developers. Without this fix, users on the Token Plan cannot use Xiaomi MiMo as a TTS provider in OpenClaw despite having valid, working credentials.

extent analysis

TL;DR

Update the authentication header in the Xiaomi TTS provider to use Authorization: Bearer instead of api-key to support Token Plan users.

Guidance

  • Verify that the api-key header is the cause of the 401 error by testing with curl commands as described in the issue.
  • Update the speech-provider-B1-Tp_iU.js file to use the Authorization: Bearer header, as shown in the suggested fix.
  • Test the updated provider with both pay-as-you-go and Token Plan credentials to ensure backward compatibility.
  • Consider reaching out to Xiaomi MiMo support to confirm the fix and ensure it aligns with their authentication requirements.

Example

headers: {
-  "api-key": apiKey,
+  "Authorization": `Bearer ${apiKey}`,
  "Content-Type": "application/json"
}

Notes

This fix assumes that the Authorization: Bearer header is compatible with the pay-as-you-go endpoint, as stated in the issue. If this is not the case, additional changes may be required.

Recommendation

Apply the workaround by updating the authentication header to Authorization: Bearer, as it maintains compatibility with the pay-as-you-go endpoint and enables Token Plan users to use MiMo TTS natively.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix fix(tts/xiaomi): Xiaomi Token Plan endpoint uses Bearer auth, not api-key header [1 comments, 2 participants]