Skip to content

CN auth header incompatibility: mmx text chat fails with 1033 via x-api-key, succeeds with Authorization Bearer #59

@Mirko214

Description

@Mirko214

Summary

mmx text chat fails on MiniMax CN with HTTP 500 / system error (1033) when using API-key auth from CLI.

Same request succeeds against the same endpoint when sent manually with Authorization: Bearer <key>.

This suggests a compatibility/auth-header issue in CLI request construction for CN text endpoint.

Environment

  • mmx-cli: 1.0.5
  • Region: cn
  • Base URL: https://api.minimaxi.com
  • Command path: text chat (Anthropic Messages API)

Repro

1) Login works and quota works

mmx auth login --api-key sk-... --region cn
mmx quota --region cn

Both succeed.

2) CLI text chat fails

mmx text chat --message "你好" --model MiniMax-M2.7 --region cn --verbose --output json

Verbose shows request goes to:

POST https://api.minimaxi.com/anthropic/v1/messages

Response:

{
  "error": {
    "code": 1,
    "message": "API error: system error (1033) (HTTP 500)"
  }
}

3) Same endpoint succeeds with Bearer auth

curl https://api.minimaxi.com/anthropic/v1/messages \
  -H "Authorization: Bearer sk-..." \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "MiniMax-M2.7",
    "max_tokens": 64,
    "messages": [{"role": "user","content": "你好"}]
  }'

This returns a normal assistant response.

4) Same endpoint fails with x-api-key

curl https://api.minimaxi.com/anthropic/v1/messages \
  -H "x-api-key: sk-..." \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
    "model": "MiniMax-M2.7",
    "max_tokens": 64,
    "messages": [{"role": "user","content": "你好"}]
  }'

Returns:

{"type":"error","error":{"type":"api_error","message":"system error (1033)"}}

Additional signal

On non-anthropic CN text endpoint, server explicitly asks for Authorization header:

{
  "base_resp": {
    "status_code": 1004,
    "status_msg": "login fail: Please carry the API secret key in the 'Authorization' field of the request header"
  }
}

Expected

mmx text chat should work with CN API key login, or auto-switch to the auth header style required by the CN endpoint.

Actual

mmx text chat consistently fails with 1033 under CN while direct Bearer request works.


Happy to test a patch build if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions