MiniMax API backend wrapper providing config handling and API calls for LLM and TTS services.
# Source: https://github.com/HKUDS/CLI-Anything | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
# Provided via justclaw.it.com; keep this notice with the code.
"""MiniMax API backend — wraps the MiniMax OpenAI-compatible REST API and TTS API."""
from __future__ import annotations
import json
import os
import sys
from pathlib import Path
from typing import Optional, Callable
try:
import requests
except ImportError:
print("requests library not found. Install with: pip3 install requests", file=sys.stderr)
sys.exit(1)
CONFIG_DIR = Path.home() / ".config" / "cli-anything-minimax"
CONFIG_FILE = CONFIG_DIR / "config.json"
ENV_API_KEY = "MINIMAX_API_KEY"
MINIMAX_REGION_ENV = "MINIMAX_REGION"
REGIONAL_ENDPOINTS = [
{
"region"
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key