openclaw - ✅(Solved) Fix MiniMax TTS does not resolve env-style apiKey in messages.tts.providers.minimax [1 pull requests, 1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

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#62314Fetched 2026-04-08 03:06:11
View on GitHub
Comments
1
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
commented ×1cross-referenced ×1

OpenClaw 2026.4.5 fails to use MiniMax TTS when messages.tts.providers.minimax.apiKey is configured as env:MINIMAX_API_KEY.

Root Cause

This makes MiniMax TTS behave differently from the rest of the MiniMax provider setup and forces users to store raw secrets directly in config to make TTS work.

Fix Action

Fixed

PR fix notes

PR #62352: fix(minimax): resolve env-style apiKey for TTS provider config

Description (problem / solution / changelog)

Summary

  • Fix MiniMax TTS apiKey handling so messages.tts.providers.minimax.apiKey: "env:MINIMAX_API_KEY" resolves from process env instead of being sent as a literal string.
  • Reuse the same behavior for talk provider overrides (talk.providers.minimax.apiKey) for consistency.
  • Add regression test covering env-style apiKey resolution in synthesize.

Linked issue

  • Closes #62314

Why this is safe

  • Change scope is limited to MiniMax speech provider key resolution.
  • Existing plaintext apiKey behavior is unchanged.
  • If env marker cannot resolve, existing fallback (process.env.MINIMAX_API_KEY) still applies.

Verification

  • corepack pnpm exec vitest extensions/minimax/speech-provider.test.ts -t "resolves env-style apiKey from provider config"
  • corepack pnpm exec vitest extensions/minimax/speech-provider.test.ts

Notes

  • Checked for collision before opening: no open PR currently targeting issue #62314 or this exact MiniMax TTS env-style fix.

Changed files

  • extensions/minimax/speech-provider.test.ts (modified, +63/-0)
  • extensions/minimax/speech-provider.ts (modified, +34/-9)

Code Example

{
  "messages": {
    "tts": {
      "provider": "minimax",
      "enabled": true,
      "providers": {
        "minimax": {
          "apiKey": "env:MINIMAX_API_KEY",
          "baseUrl": "https://api.minimaxi.com",
          "model": "speech-2.8-hd",
          "voiceId": "Chinese (Mandarin)_Warm_Girl"
        }
      }
    }
  }
}

---

npx openclaw gateway call tts.convert --params '{"text":"hello","voice":"Chinese (Mandarin)_Warm_Girl","model":"speech-2.8-hd"}' --json

---

TTS conversion failed: minimax: MiniMax TTS API returned no audio data
RAW_BUFFERClick to expand / collapse

Summary

OpenClaw 2026.4.5 fails to use MiniMax TTS when messages.tts.providers.minimax.apiKey is configured as env:MINIMAX_API_KEY.

Environment

  • OpenClaw: 2026.4.5
  • MiniMax CN endpoint: https://api.minimaxi.com
  • TTS model: speech-2.8-hd
  • Voice: Chinese (Mandarin)_Warm_Girl

Config

{
  "messages": {
    "tts": {
      "provider": "minimax",
      "enabled": true,
      "providers": {
        "minimax": {
          "apiKey": "env:MINIMAX_API_KEY",
          "baseUrl": "https://api.minimaxi.com",
          "model": "speech-2.8-hd",
          "voiceId": "Chinese (Mandarin)_Warm_Girl"
        }
      }
    }
  }
}

Repro

npx openclaw gateway call tts.convert --params '{"text":"hello","voice":"Chinese (Mandarin)_Warm_Girl","model":"speech-2.8-hd"}' --json

Actual result

tts.convert fails with:

TTS conversion failed: minimax: MiniMax TTS API returned no audio data

Expected result

MiniMax TTS should synthesize audio successfully, same as direct API usage.

Key evidence

  1. Direct request to MiniMax CN TTS API succeeds with the same key:
    • POST https://api.minimaxi.com/v1/t2a_v2
    • returns base_resp.status_code = 0 and audio payload
  2. Local inspection of OpenClaw speech runtime shows providerConfig.apiKey is still the literal string env:MINIMAX_API_KEY, not the resolved secret value.
  3. If the real key is written directly into messages.tts.providers.minimax.apiKey, MiniMax TTS works.

Suspected root cause

The MiniMax TTS provider path in extensions/speech-core / speech-provider-CT0RIfj6.js does not resolve env: style secret values the same way other provider paths do.

Why this matters

This makes MiniMax TTS behave differently from the rest of the MiniMax provider setup and forces users to store raw secrets directly in config to make TTS work.

extent analysis

TL;DR

The most likely fix is to modify the speech-provider-CT0RIfj6.js file to properly resolve env: style secret values for the MiniMax TTS provider.

Guidance

  • Verify that the MINIMAX_API_KEY environment variable is set correctly and accessible by the OpenClaw application.
  • Check the speech-provider-CT0RIfj6.js file to see if it has a different implementation for resolving environment variables compared to other provider paths.
  • Consider modifying the speech-provider-CT0RIfj6.js file to use a consistent method for resolving environment variables, such as using a library or function that can handle env: style secret values.
  • Test the modified provider file with the env:MINIMAX_API_KEY configuration to ensure that it resolves the secret value correctly and enables MiniMax TTS to work as expected.

Example

No code snippet is provided as the issue does not contain sufficient information about the implementation details of the speech-provider-CT0RIfj6.js file.

Notes

The fix may require modifications to the OpenClaw codebase, specifically the speech-provider-CT0RIfj6.js file. It is also possible that the issue is related to the way environment variables are handled in the OpenClaw application, and further investigation may be needed to determine the root cause.

Recommendation

Apply a workaround by modifying the speech-provider-CT0RIfj6.js file to properly resolve env: style secret values, as this is the most likely cause of the issue and will allow MiniMax TTS to work as expected.

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