Fosowl/agenticSeek · error · Exception
MiniMax API error: {str(e)}
Error message
MiniMax API error: {str(e)} What it means
The catch-all in minimax_fn: every exception inside the try block — OpenAI SDK HTTP errors (401/429/5xx), connection failures, and the internal 'MiniMax response is empty.' raise — is re-wrapped as 'MiniMax API error: <details>' with the original exception chained via 'from e'.
Source
Thrown at sources/llm_provider.py:471
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,
CloudflareError,
APIError
)
thought = ""
message = '\n---\n'.join([f"{msg['role']}: {msg['content']}" for msg in history])
View on GitHub (pinned to ae57a23577)
Solutions
- Inspect the chained __cause__ for the exact HTTP status/message
- Validate MINIMAX_API_KEY and re-generate if expired
- Verify MINIMAX_BASE_URL against current MiniMax docs
- Test connectivity: curl the base_url to rule out network/firewall blocks
- Retry with backoff on 429/5xx responses
Example fix
// before
client = OpenAI(api_key=None, base_url=base_url)
// after
client = OpenAI(api_key=os.getenv("MINIMAX_API_KEY"), base_url=base_url) Defensive patterns
Strategy: try-catch
Validate before calling
import os, requests
def minimax_ok():
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 Try / catch
try:
out = provider.minimax_fn(history)
except Exception as e:
cause = e.__cause__
status = getattr(cause, 'status_code', None)
if status == 401:
log.error('MiniMax auth failed: check MINIMAX_API_KEY')
elif status == 429:
time.sleep(30); retry()
else:
raise Prevention
- Store MINIMAX_API_KEY in .env and validate it at startup
- Confirm MINIMAX_BASE_URL against current MiniMax docs
- Add retry with backoff for 429/5xx
- Branch on the chained exception's HTTP status code
When it happens
Trigger: Any failure during the MiniMax chat completion call: invalid API key, wrong base URL, network error, rate limit, unsupported model, or the None-response guard firing.
Common situations: Missing/expired MINIMAX_API_KEY; MINIMAX_BASE_URL misconfigured (wrong region/legacy domain); firewall blocking api.minimax.io; exceeding MiniMax rate limits; deprecated model slug.
Related errors
- Together AI API error: {str(e)}
- Deepseek API error: {str(e)}
- OpenRouter API error: {str(e)}
- MiniMax response is empty.
- Provider {self.provider_name} failed: {str(e)}
AI-assisted analysis of Fosowl/agenticSeek@ae57a23577 (2026-08-30).
Data as JSON: /api/errors/58f62d16ca3771a0.
Report an issue: GitHub.