Skip to content

fix(tts/xiaomi): Xiaomi Token Plan endpoint uses Bearer auth, not api-key header #77692

Description

@kidding1412

`## 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-go Token Plan (Orbit)
Endpoint https://api.xiaomimimo.com/v1 https://token-plan-cn.xiaomimimo.com/v1
API Key prefix sk- tp-
Auth header api-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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions