{"record":{"id":"e7840cc7474942d4","repo":"MiniMax-AI/skills","slug":"error-minimax-api-base-is-not-set-e7840c","errorCode":null,"errorMessage":"ERROR: MINIMAX_API_BASE is not set.","messagePattern":"ERROR: MINIMAX_API_BASE is not set\\.","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"critical","filePath":"skills/gif-sticker-maker/scripts/minimax_video.py","lineNumber":30,"sourceCode":"  python minimax_video.py \"Figurine laughing\" --image laugh.png -o laugh.mp4 --duration 6\n\nEnv: MINIMAX_API_KEY (required)\n\"\"\"\n\nimport os\nimport sys\nimport json\nimport time\nimport base64\nimport argparse\nimport requests\n\nAPI_KEY = os.getenv(\"MINIMAX_API_KEY\")\n# China Mainland: https://api.minimaxi.com/v1\n# Overseas:       https://api.minimax.io/v1\nAPI_BASE = os.getenv(\"MINIMAX_API_BASE\")\nif not API_BASE:\n    raise SystemExit(\"ERROR: MINIMAX_API_BASE is not set.\")\n\nI2V_MODELS = [\n    \"MiniMax-Hailuo-2.3\",\n    \"MiniMax-Hailuo-2.3-Fast\",\n    \"MiniMax-Hailuo-02\",\n    \"I2V-01-Director\",\n    \"I2V-01-live\",\n    \"I2V-01\",\n]\n\nT2V_MODELS = [\n    \"MiniMax-Hailuo-2.3\",\n    \"MiniMax-Hailuo-02\",\n    \"T2V-01-Director\",\n    \"T2V-01\",\n]\n\n","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/MiniMax-AI/skills/blob/60aaae52bb2af8162732751a4332f62a5fef518b/skills/gif-sticker-maker/scripts/minimax_video.py#L12-L48","documentation":"Raised at module import time: lines 28-30 read MINIMAX_API_BASE and immediately SystemExit if it is empty. Unlike the API-key check (which is lazy), this runs on import, so merely importing minimax_video without the env var kills the interpreter. The variable selects the regional endpoint (China mainland: https://api.minimaxi.com/v1, overseas: https://api.minimax.io/v1).","triggerScenarios":"Importing or running minimax_video.py when MINIMAX_API_BASE is unset or empty. The check executes before any function call, so even 'import minimax_video' triggers it.","commonSituations":"New shell without sourced env; CI runner missing the secret; typo (MINIMAX_API_BASE vs MINIMAX_BASE); forgetting the /v1 path suffix; using the wrong region endpoint for the account.","solutions":["export MINIMAX_API_BASE='https://api.minimax.io/v1' (overseas) or 'https://api.minimaxi.com/v1' (China mainland).","Persist it in your shell profile or a .env loaded by the runner.","Verify: echo $MINIMAX_API_BASE"],"exampleFix":"# before\npython minimax_video.py 'prompt' -o out.mp4   # SystemExit at import\n\n# after\nexport MINIMAX_API_BASE='https://api.minimax.io/v1'\nexport MINIMAX_API_KEY='...'\npython minimax_video.py 'prompt' -o out.mp4","handlingStrategy":"validation","validationCode":"import os\nbase = os.getenv('MINIMAX_API_BASE')\nif not base:\n    raise EnvironmentError('Set MINIMAX_API_BASE (overseas: https://api.minimax.io/v1, CN: https://api.minimaxi.com/v1)')\nif not base.rstrip('/').endswith('/v1'):\n    raise EnvironmentError('MINIMAX_API_BASE must end with /v1')","typeGuard":null,"tryCatchPattern":"try:\n    import minimax_video\nexcept SystemExit:\n    raise RuntimeError('MINIMAX_API_BASE not configured; cannot load video module')","preventionTips":["Set MINIMAX_API_BASE in your shell profile alongside MINIMAX_API_KEY.","Always include the /v1 path suffix.","Pick the region matching your API key (overseas .io vs China .com)."],"tags":["config","environment","minimax","video-generation"],"backgroundTag":null,"analyzedSha":"60aaae52bb2af8162732751a4332f62a5fef518b","analyzedAt":"2026-08-13T17:32:34.717Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}