#17602: fix: correct MiniMax M2.5 pricing constants (75x overcharge)
commands
agents
stale
size: XS
Cluster:
MiniMax API Fixes
## Summary
- Problem: MiniMax M2.5 pricing constants were ~75x higher than actual official pricing, causing `/usage cost` to report wildly inflated costs (e.g., $2.25 instead of $0.03)
- Why it matters: Users on MiniMax models see incorrect cost tracking, eroding trust in usage reporting
- What changed: Updated `MINIMAX_API_COST` to match [official MiniMax pricing](https://platform.minimaxi.com/document/Price), added separate `MINIMAX_LIGHTNING_API_COST` for Lightning models, extended `buildMinimaxModel()` to accept optional `cost` parameter
- What did NOT change (scope boundary): No changes to cost calculation logic, display formatting, or other provider pricing
## Change Type (select all)
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [ ] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [ ] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
> Note: Affects `agents` (model config) and `commands` (onboarding auth models) — pricing constants only.
## Linked Issue/PR
- Closes #17548
## User-visible / Behavior Changes
- `/usage cost` now reports accurate costs for MiniMax models
- Example: A session previously reported as ~$2.25 will now correctly show ~$0.03
- Lightning models (`MiniMax-M2.1-Lightning`, `MiniMax-M2.5-Lightning`) now have separate accurate pricing ($2.40/1M output vs $1.20/1M standard)
## Security Impact (required)
- New permissions/capabilities? `No`
- Secrets/tokens handling changed? `No`
- New/changed network calls? `No`
- Command/tool execution surface changed? `No`
- Data access scope changed? `No`
## Repro + Verification
### Environment
- OS: Ubuntu 24.04
- Runtime/container: Node.js v22.22.0
- Model/provider: MiniMax M2.5 / M2.1-Lightning / M2.5-Lightning
- Integration/channel: N/A
- Relevant config: Any config using MiniMax models
### Steps
1. Configure a MiniMax model as primary or fallback
2. Run a session and check `/usage cost`
3. Before fix: costs reported ~75x higher than actual
4. After fix: costs match [official MiniMax pricing](https://platform.minimaxi.com/document/Price)
### Expected
- Cost per 1M tokens: Input $0.30, Output $1.20 (standard) / $2.40 (Lightning)
### Actual (before fix)
- Cost per 1M tokens: Input $15, Output $60
## Evidence
- [x] TypeScript compilation: 0 errors
- [x] Linting (oxlint): 0 warnings, 0 errors
- [x] Formatting (oxfmt): Applied
- [x] Pricing verified against [official MiniMax documentation](https://platform.minimaxi.com/document/Price)
## Human Verification (required)
- Verified scenarios: TSC compilation, lint, format pass; pricing constants cross-referenced with official MiniMax pricing page
- Edge cases checked: Lightning vs standard model separation, cache read/write pricing, both duplicate constant locations (`models-config.providers.ts` and `onboard-auth.models.ts`)
- What you did **not** verify: Live MiniMax API session cost comparison (verified via pricing documentation)
## Compatibility / Migration
- Backward compatible? `Yes`
- Config/env changes? `No`
- Migration needed? `No`
## Failure Recovery (if this breaks)
- How to disable/revert this change quickly: Revert the two files
- Files/config to restore: `src/agents/models-config.providers.ts`, `src/commands/onboard-auth.models.ts`
- Known bad symptoms: Incorrect cost reporting for MiniMax models
## Risks and Mitigations
- Risk: Pricing may change if MiniMax updates their rates
- Mitigation: Values sourced directly from official documentation; same risk exists for all hardcoded provider pricing
---
🤖 AI-assisted (Opus 4.6 implementation, reviewed by Opus 4.6 + GPT 5.3 Codex with thinking high). Fully tested (TSC + lint). I understand what the code does.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Fixes MiniMax model pricing constants that were ~75x higher than actual official rates, causing `/usage cost` to report wildly inflated costs. Both duplicate constant locations (`models-config.providers.ts` and `onboard-auth.models.ts`) are updated to match [official MiniMax pricing](https://platform.minimaxi.com/document/Price).
- Updated `MINIMAX_API_COST` from $15/$60 (input/output per 1M tokens) to the correct $0.30/$1.20
- Added separate `MINIMAX_LIGHTNING_API_COST` ($0.30 input / $2.40 output) for Lightning models (`MiniMax-M2.1-Lightning`, `MiniMax-M2.5-Lightning`)
- Extended `buildMinimaxModel()` and `buildMinimaxTextModel()` with optional `cost` parameter, defaulting to standard pricing
- Cache pricing also corrected: `cacheRead` from $2 to $0.03, `cacheWrite` from $10 to $0.375
- No changes to cost calculation logic, display formatting, or other provider pricing
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge — it only changes hardcoded pricing constants with no logic or control flow modifications.
- The changes are limited to correcting numerical pricing constants in two files and adding a new cost constant for Lightning models. The optional `cost` parameter addition to builder functions is backward-compatible (defaults to existing behavior). Both constant locations are updated consistently. The onboarding path (`buildMinimaxApiModelDefinition`) doesn't currently handle Lightning models, which is a minor gap but not a regression since those model IDs are not passed through onboarding flows.
- No files require special attention
<sub>Last reviewed commit: 85e6892</sub>
<!-- greptile_other_comments_section -->
<sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#20779: fix(providers): rename MiniMax M2.5 Lightning to M2.5 highspeed
by ccclyt · 2026-02-19
83.3%
#19351: fix: enable tool_use/result pairing repair for MiniMax models
by thebtf · 2026-02-17
74.2%
#4734: fix: auto-detect China region for MiniMax API endpoint selection
by akramcodez · 2026-01-30
73.9%
#16543: [AI-assisted] feat(usage): support cache-hit differentiated pricing
by OwenJiong24 · 2026-02-14
73.7%
#13215: fix: pass agentId to loadCostUsageSummary in /usage cost command
by veast · 2026-02-10
71.0%
#20675: fix(minimax): enable tool-use/result repair and drop malformed assi...
by jamesbuddy-claw · 2026-02-19
70.6%
#19114: feat(usage): add default model costs for session_status
by Clawborn · 2026-02-17
70.0%
#8660: fix: respect agents.defaults.models.*.params.maxTokens in image tool
by dbottme · 2026-02-04
69.3%
#20650: fix(gateway): include deleted/reset sessions in usage.cost RPC (#20...
by lailoo · 2026-02-19
68.8%
#20603: fix(gateway): scan all agents in usage.cost RPC (#20558)
by lailoo · 2026-02-19
68.5%