Skip to content

fix(#170): MiniMax-M2.7/M2.5-highspeed pricing for nix-v1 cost tracking#171

Merged
arniesaha merged 1 commit intomainfrom
fix/minimax-cost-pricing
Apr 17, 2026
Merged

fix(#170): MiniMax-M2.7/M2.5-highspeed pricing for nix-v1 cost tracking#171
arniesaha merged 1 commit intomainfrom
fix/minimax-cost-pricing

Conversation

@arniesaha
Copy link
Copy Markdown
Owner

Summary

  • Adds minimax-m2.7-highspeed and minimax-m2.5-highspeed to _DEFAULT_PRICING so MiniMax calls from the nix-v1 OpenClaw agent produce a real cost.usd instead of -1.0.
  • Rates pulled from MiniMax's official pay-as-you-go page; M2.7 and M2.5 differ only in cache-read ($0.06/M vs $0.03/M).
  • Tests cover base pricing, cache-aware path, and the cache-read differential.

Closes #170

Test plan

  • pytest sdk/python/tests/test_pricing.py — 38 passed locally (4 new tests).
  • After merge + proxy redeploy, query Tempo for recent MiniMax-*-highspeed spans and confirm cost.usd > 0.
  • Dashboard Total Cost card picks up MiniMax contributions over a multi-day window.

🤖 Generated with Claude Code

…able

MiniMax calls from the nix-v1 OpenClaw agent were emitting cost.usd=-1.0
because these model names were absent from _DEFAULT_PRICING. Adds entries
with the official pay-as-you-go rates from
https://platform.minimax.io/docs/guides/pricing-paygo — $0.60/M input,
$2.40/M output, plus cache_read/cache_write. M2.7 and M2.5 differ only
in cache_read ($0.06/M vs $0.03/M).

Tests cover base pricing, cache-aware path, and the M2.5/M2.7 cache-read
differential.

Closes #170

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@arniesaha arniesaha merged commit c4b9bd3 into main Apr 17, 2026
5 checks passed
@arniesaha arniesaha deleted the fix/minimax-cost-pricing branch April 17, 2026 10:40
arniesaha added a commit that referenced this pull request Apr 17, 2026
…spans

Two compounding bugs caused MiniMax calls to show 0 in the dashboard Total
Cost / LLM Calls cards even after #171 added MiniMax to the Python pricing
table:

1. openclaw-agentweave-bridge copied OpenClaw's model.usage.costUsd
   verbatim. OpenClaw doesn't know MiniMax pricing and reports 0, so spans
   landed in Tempo with cost.usd=0. The Python compute_cost() is never in
   the bridge's code path.

2. dashboard tempoSearchQuery filtered on prov.activity.type = "llm_call",
   but bridge-emitted spans have activity.type = "agent_turn". Those spans
   were excluded from traceRows even though the Prometheus chart (using
   span metrics, no activity filter) still showed them.

Adds plugins/openclaw-agentweave-bridge/src/pricing.ts mirroring the Python
table (MiniMax + Anthropic + OpenAI + Codex aliases). resolveCost() prefers
a positive upstream value and falls back to the local table when upstream
is 0 / negative / NaN. Widens the dashboard filter to also match agent_turn
spans with a non-empty prov.llm.model.

Closes #172

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
arniesaha added a commit that referenced this pull request Apr 17, 2026
…spans (#173)

Two compounding bugs caused MiniMax calls to show 0 in the dashboard Total
Cost / LLM Calls cards even after #171 added MiniMax to the Python pricing
table:

1. openclaw-agentweave-bridge copied OpenClaw's model.usage.costUsd
   verbatim. OpenClaw doesn't know MiniMax pricing and reports 0, so spans
   landed in Tempo with cost.usd=0. The Python compute_cost() is never in
   the bridge's code path.

2. dashboard tempoSearchQuery filtered on prov.activity.type = "llm_call",
   but bridge-emitted spans have activity.type = "agent_turn". Those spans
   were excluded from traceRows even though the Prometheus chart (using
   span metrics, no activity filter) still showed them.

Adds plugins/openclaw-agentweave-bridge/src/pricing.ts mirroring the Python
table (MiniMax + Anthropic + OpenAI + Codex aliases). resolveCost() prefers
a positive upstream value and falls back to the local table when upstream
is 0 / negative / NaN. Widens the dashboard filter to also match agent_turn
spans with a non-empty prov.llm.model.

Closes #172

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add cost tracking for MiniMax-M2.7-highspeed and M2.5-highspeed

1 participant