MiniMax-AI / MiniMax-AI/minimax-code
BYOK minimax_api provider cannot work with OpenAI-compatible third-party relay (X-Api-Key hardcoded) - mobile channel messages fail with 'login fail'
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1.3k
- Forks
- 141
- Avg merge
- 2h 45m
- Merged PRs (30d)
- 46
Description
Environment
- MiniMax Code 3.0.60, macOS
minimaxModelSource: minimax_api_key- A custom provider (
openai-completions+Authorization: Bearer) works fine for desktop chat and is the default model
Symptom
Messages sent from the mobile app (connected to desktop) fail with:
BYOK provider minimax_api upstream error: login fail: Please carry the API secret key in the 'X-Api-Key' field of the request header
Root cause analysis (verified against app behavior)
- The
minimax_apiprovider defaults tohttps://api.minimaxi.com/anthropic(official endpoint). The configuredminimax_api.apiKeyis a key for a third-party OpenAI-compatible relay. parseMinimaxApiConfigonly acceptsapiKeyandbaseURL— there is no way to configure a custom auth header for the upstream.- The SDK's
apiKeyAuthsends the key asX-Api-Keyheader, but the relay only acceptsAuthorization: Bearer(verified:X-Api-Key→401 Missing API key;Bearer→200 OK). The relay does expose an Anthropic-compatible endpoint (/v1/messages). - In the same turn,
custom_provider:minimax-2(openai-completions, Bearer) succeeds whileminimax_apifails — some mobile-channel requests resolve to the unprefixed builtin MiniMax model and hitminimax_api.
Expected behavior
- Allow
minimax_api(or custom providers) to configure auth asAuthorization: Bearer/authToken, so BYOK users with third-party relays can use them for the mobile channel. - Or: mobile-channel auxiliary requests should use the same
custom_providermodel as the main conversation instead of falling back tominimax_api.
Logs
~/.minimax/v2/observability/logs/runtime-2026081123.log — entries BYOK provider minimax_api upstream error: login fail: ... at 23:40 / 23:45 / 23:47
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at parseMinimaxApiConfig and apiKeyAuth, then trace how mobile-channel requests resolve the unprefixed MiniMax model versus custom_provider:minimax-2. Use the listed runtime log entries to reproduce the failure. Done means the mobile channel can use the configured relay with Bearer authentication or consistently uses the selected custom provider without falling back to minimax_api.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100