Fosowl/agenticSeek · error · Exception

MiniMax response is empty.

Error message

MiniMax response is empty.

What it means

minimax_fn checks the chat completion response and raises 'MiniMax response is empty.' when the SDK returns None. It guards against MiniMax's OpenAI-compatible endpoint returning an empty body instead of a valid choices structure.

Source

Thrown at sources/llm_provider.py:465

        - MiniMax-M2.7: Previous flagship, kept for compatibility
        - MiniMax-M2.7-highspeed: High-speed version of M2.7 for low-latency scenarios

        Note: temperature must be in range (0.0, 1.0], default is 1.0
        """
        load_dotenv()
        base_url = os.getenv("MINIMAX_BASE_URL", "https://api.minimax.io/v1")

        client = OpenAI(api_key=self.api_key, base_url=base_url)
        if self.is_local:
            raise Exception("MiniMax is not available for local use. Change config.ini")
        try:
            response = client.chat.completions.create(
                model=self.model,
                messages=history,
                temperature=1.0,
            )
            if response is None:
                raise Exception("MiniMax response is empty.")
            thought = response.choices[0].message.content
            if verbose:
                print(thought)
            return thought
        except Exception as e:
            raise Exception(f"MiniMax API error: {str(e)}") from e

    def dsk_deepseek(self, history, verbose=False):
        """
        Use: xtekky/deepseek4free
        For free api. Api key should be set to DSK_DEEPSEEK_API_KEY
        This is an unofficial provider, you'll have to find how to set it up yourself.
        """
        from dsk.api import (
            DeepSeekAPI,
            AuthenticationError,
            RateLimitError,
            NetworkError,

View on GitHub (pinned to ae57a23577)

Solutions

  1. Verify MINIMAX_API_KEY is set and valid
  2. Check MINIMAX_BASE_URL is the correct current endpoint (default https://api.minimax.io/v1)
  3. Confirm the configured model name is valid for your MiniMax account/region
  4. Retry later if MiniMax is experiencing an outage
  5. Handle None explicitly in calling code and surface a clear user-facing message

Example fix

// before
base_url = "https://api.minimax.chat/v1"  # legacy domain
// after
base_url = os.getenv("MINIMAX_BASE_URL", "https://api.minimax.io/v1")
Defensive patterns

Strategy: type-guard

Validate before calling

import os, requests
def minimax_ready():
    key = os.getenv('MINIMAX_API_KEY')
    base = os.getenv('MINIMAX_BASE_URL', 'https://api.minimax.io/v1')
    if not key:
        return False
    try:
        return requests.get(base + '/models', headers={'Authorization': f'Bearer {key}'}, timeout=10).ok
    except requests.RequestException:
        return False

Type guard

def has_minimax_content(resp):
    return resp is not None and getattr(resp, 'choices', None) and resp.choices[0].message.content is not None

Try / catch

try:
    out = provider.minimax_fn(history)
except Exception as e:
    if 'response is empty' in str(e):
        log.warning('MiniMax empty response: verify API key, base URL and model')
    raise

Prevention

When it happens

Trigger: client.chat.completions.create(...) against MINIMAX_BASE_URL returns None — e.g. invalid API key yielding an empty body, wrong base_url region endpoint (api.minimax.io vs api.minimaxi.com), unsupported model name, or MiniMax service degradation.

Common situations: MINIMAX_BASE_URL env var pointing at a wrong/legacy domain; invalid or expired MINIMAX_API_KEY; model slug not available to the account; MiniMax outage returning empty payloads.

Related errors


AI-assisted analysis of Fosowl/agenticSeek@ae57a23577 (2026-08-30). Data as JSON: /api/errors/b002d5ed0884057c. Report an issue: GitHub.