Skip to content

minimax provider ignores custom base_url, hardcodes api.minimax.io causing 401 #6039

@lghi

Description

@lghi

Bug Description

The minimax provider in Hermes Agent ignores the model.base_url set in config.yaml and hardcodes https://api.minimax.io as the base URL, causing 401 authentication errors.

Steps to Reproduce

  1. Install Hermes Agent (v0.7.0)
  2. Configure minimax provider with correct base URL and API key:
    hermes config set model.provider minimax
    hermes config set model.base_url https://api.minimaxi.com/anthropic
    hermes config set minimax.api_key <key>
    
  3. Run hermes and send any message
  4. Observe: API calls go to https://api.minimax.io/anthropic/chat/completions (401) instead of https://api.minimaxi.com/anthropic/v1/messages (200)

Expected Behavior

When model.base_url is explicitly set in config.yaml, Hermes should use that URL. The provider should respect user configuration.

Actual Behavior

Hermes ignores the config and hardcodes api.minimax.io in the request URL. The debug dump shows:

  • Request URL: https://api.minimax.io/anthropic/chat/completions
  • Config base_url: https://api.minimaxi.com/anthropic

The minimax provider appears to be hardcoded somewhere in the provider resolution logic, bypassing the user config.

Environment

  • Hermes Agent v0.7.0 (2026.4.3)
  • macOS
  • Python 3.11

Additional Context

  • The API key works correctly when called directly via curl with the correct endpoint:
    • https://api.minimaxi.com/anthropic/v1/messages returns 200
    • https://api.minimax.io/anthropic/chat/completions returns 401
  • The minimax API uses Anthropic message format (/v1/messages), not OpenAI chat completions format (/chat/completions)
  • Even setting model.base_url in config.yaml has no effect — the hardcoded URL always wins

Config

model:
  provider: minimax
  base_url: https://api.minimaxi.com/anthropic
  default: MiniMax-M2.7

custom_providers:
  - name: minimax
    base_url: https://api.minimaxi.com/anthropic
    api_key: <key>
    api_mode: chat_completions

Suggestion

The provider resolution logic should respect the user-specified base_url in config.yaml rather than using a hardcoded fallback. Alternatively, the minimax provider should be documented as supporting only the Anthropic message format (/v1/messages), not OpenAI's /chat/completions format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt builderprovider/minimaxMiniMax (Anthropic transport)type/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions