minimax
MiniMax M-series production wiring patterns for the OpenAI-compatible API at api.minimax.io. TRIGGERS - MiniMax, MiniMax-M2.7, Hailuo
What this skill does
# MiniMax M-series Production Wiring
OpenAI-compatible chat-completion endpoint at `https://api.minimax.io/v1` with the **M2.7-highspeed reasoning model** (premium tier as of 2026-04-29). LOOKS LIKE OPENAI but **silently drops 6 OpenAI parameters** and exposes `<think>` reasoning traces inside `content`. Beyond chat-completion, the API is MiniMax-native (different URLs, different body shapes, different error envelopes โ HTTP 200 + `base_resp.status_code` instead of HTTP 4xx).
The model itself is a **competent qualitative judge + theory explainer + tool orchestrator** for finance/quant work, but **cannot do raw math** on realistic data sizes (saturates reasoning budget) and **hallucinates plausible details** under input uncertainty (6 documented instances). For production: pair it with Python for math, sandbox validators for code, and deterministic detectors for pattern recognition.
> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed โ fix this file immediately, don't defer. Only update for real, reproducible issues. Source-of-truth campaign archive: `~/own/amonic/minimax/` (read-only reference; do not modify from this skill).
> **๐ MiniMax-M3 is live (2026-06-01).** This file covers **M2.7**. For M3 โ native vision,
> `reasoning_split` clean output, `response_format` acceptance, 512K input ceiling / 512K output cap,
> `n=1`, and the docs-vs-reality discrepancies โ use the sibling skill
> [`../m3/SKILL.md`](../m3/SKILL.md) and the evidence doc
> [`../../references/M3-EMPIRICAL.md`](../../references/M3-EMPIRICAL.md). The defensive snippets
> below (`<think>` strip, `base_resp` retry, cached-token reader) apply to M3 unchanged.
---
## When to use M2.7 vs not โ the decision table
| Workload | Verdict | Why |
| ---------------------------------------------- | --------------------------- | ------------------------------------------------------------------------------------------ |
| Tagging / classification (5-15 token outputs) | โ
Use plain `MiniMax-M2.7` | Plain is 2.5ร faster than -highspeed for short outputs (cross-over at ~150 tokens). |
| Summarization / long-form generation | โ
Use `-highspeed` | -highspeed wins at >150 tokens. ~50 TPS asymptote (NOT the 100 TPS plan claim). |
| Trade signal JSON output | โ
Production-ready | 6/6 verified across L1+L2+L3 layers with strict system prompt. Confidence well-calibrated. |
| Financial theory explanation | โ
Graduate-level | Black-Scholes derivations, FTAP, KKT, vol skew microstructure all correct. |
| Long-context retrieval (โค 30K tokens) | โ
4/4 needle retrieval | NO "lost in the middle" effect. Perfect retrieval at 10/50/85/98% positions. |
| Tool orchestration (agent loop) | โ
4/4 correct selection | Parallel + chained tool calls work. Refuses irrelevant queries gracefully. |
| Math / Black-Scholes / Sharpe on Nโฅ50 returns | โ DO NOT USE | Saturates 8-16K reasoning tokens; route to Python (numpy/scipy/cvxpy). |
| QP / constrained optimization (Markowitz) | โ DO NOT USE | Same saturation pattern. Use scipy.optimize / cvxpy. |
| Risk metrics on realistic data (N=252 returns) | โ DO NOT USE | Even SINGLE metric saturates. Pre-summarize aggregates before passing. |
| Chart pattern recognition | โ DO NOT USE | Hallucinates patterns in pure noise. Use TA-Lib / CV / classical algos. |
| Code generation (final, deployable) | โ ๏ธ Scaffold-only | Compiles 100%, runs 0% on first try (hallucinates library imports). Sandbox-validate. |
| Vision / image input | โ NOT SUPPORTED | M2.7 is text-only. `image_url` silently dropped at INPUT level. |
| TTS / video | โ ๏ธ Plan-gated | Endpoints exist (`/v1/t2a_v2`, `/v1/video_generation`) but error 2061 on Plus-High-Speed. |
| Embeddings (bulk RAG) | โ ๏ธ RPM-tight | `/v1/embeddings` accessible but rate-limited beyond ~5 calls. Use local embeddings. |
---
## Top 10 production rules
1. **Always set a system prompt โ it's at-most break-even, often net-positive.** Long instructions in `messages[0]` get ~70% billing rate AND replace MiniMax's hidden ~30-token default. Detailed instructions belong in system role, NEVER user content.
2. **Strip `<think>...</think>` from `content` before displaying.** M-series exposes its reasoning trace inside the content string. Production: `re.sub(r"<think>[\s\S]*?</think>\s*", "", content)`. Server-side stripping for billing on assistant replay (multi-turn doesn't double-bill).
3. **`max_tokens` โฅ 1024 for non-trivial tasks. 512 is a silent-empty footgun.** Reasoning consumes budget BEFORE visible content. Branch on `finish_reason == "length"` defensively.
4. **Trust capability params, suspect control params.** Honored: `tools`, `messages`, `max_tokens`, `temperature`, `stream`. Silently dropped: `stop`, `tool_choice`, `response_format`, streaming `usage`, `image_url`, `messages[].name`.
5. **For JSON output, prompt-engineer it โ `response_format` is silently dropped.** Strict system prompt + `temperature=0.2` + `max_tokens=4096` + `try/except json.loads` = 100% reliability (6/6 verified).
6. **Plain `MiniMax-M2.7` for short-output workloads (<150 visible tokens); `-highspeed` for long-form.** "Highspeed" is COUNTERINTUITIVELY slower for short outputs (Karakeep tagging at 5-15 tokens: plain is 2.5ร faster).
7. **Caching is COST-only on MiniMax, not LATENCY.** Add `cache_control: {type: "ephemeral"}` to system messages for ~95% input-token cost reduction; don't expect interactive-UX latency benefits. Activates at ~600+ prompt_tokens. Prefix-match works (varied user + stable system gets ~70% hit rate).
8. **Route financial math to Python โ M2.7 saturates on QP / numerical integration / Sharpe on Nโฅ50 returns.** Pre-summarize aggregates (mean / stdev / n) and pass them; M2.7 handles the final-step formula. Define financial primitives as TOOLS for agent-loop orchestration.
9. **NEVER trust M2.7-generated code without sandbox validation.** `compile()` is INSUFFICIENT. M2.7 invents library imports (`SMA`, `RSI`, `BollingerBands` from `backtesting.lib` โ none exist). Run in subprocess + capture exit code + iterative repair on failure.
10. **NO HTTP 429 โ rate-limited responses are HTTP 200 + `base_resp.status_code=1002`.** Standard retry middleware that watches HTTP status WILL NOT catch this. Use code-prefix-based handler: `1xxx` family = retry with backoff; `2xxx` family = fix request, don't retry.
---
## Canonical Tier F agentic stack (quant-LLM workflow)
```
F4: long-context retrieval โ M2.7 finds facts from filings/research
โ
F2: structured judgment as JSON โ M2.7 emits trade signal
โ
F6: tool orchestration โ M2.7 selects + calls tools (parallel + chained)
โ
F1+F8+F9: Python math layer โ numpy/scipy/cvxpy compute deterministically
โ
F3: textbook explanation โ M2.7 narrates the result with theory
โ
F5: sandbox-validated code โ M2.7 scaffolds; subprocess validates
```
**The pattern**: M2.7 for judgment / theory / orchestration; Python for math / validation / pattern detection. Never mix "explain + compute" in one prompt for complex problems โ saturation is the failure mode.
| Primitive | M2.7's role | Python's role | Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only โ no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.