openclaw - ✅(Solved) Fix [Bug] MiniMax usage tracker calls /coding_plan/remains with POST instead of GET [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#63056Fetched 2026-04-09 07:59:04
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
1
Participants
Timeline (top)
referenced ×4cross-referenced ×1

Error Message

The MiniMax usage tracker endpoint GET /v1/api/openplatform/coding_plan/remains requires an HTTP GET request, but OpenClaw calls it with POST, resulting in a 404 error.

Root Cause

The fetchMinimaxUsage() function in src/infra/provider-usage.fetch.minimax.ts calls the /coding_plan/remains endpoint using POST, but this endpoint:

  • Accepts GET requests (returns {"model_remains":[...]})
  • Returns 404 for POST requests

Fix Action

Fixed

PR fix notes

PR #63073: fix(infra): use minimax.io for usage remains #63056

Description (problem / solution / changelog)

Summary

  • Problem: MiniMax usage tracking called the /v1/api/openplatform/coding_plan/remains endpoint on the wrong host (api.minimaxi.com), which can lead to 404/invalid responses.
  • Why it matters: openclaw status --usage should reliably show MiniMax quota snapshots when configured.
  • What changed: Switched the MiniMax coding-plan remains endpoint to api.minimax.io and tightened the unit test to assert the request URL + HTTP method.
  • What did NOT change (scope boundary): Response parsing and usage derivation logic are unchanged; request method remains GET.

Change Type (select all)

  • Bug fix
  • Feature
  • Refactor required for the fix
  • 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

Linked Issue/PR

  • Fixes #63056

User-visible / Behavior Changes

  • MiniMax usage snapshots now query https://api.minimax.io/v1/api/openplatform/coding_plan/remains (previously api.minimaxi.com).

Security Impact (required)

  • New permissions/capabilities? (No)
  • Secrets/tokens handling changed? (No)
  • New/changed network calls? (Yes) — same path/method, corrected host only.
  • Command/tool execution surface changed? (No)
  • Data access scope changed? (No)

Repro + Verification

Steps

  1. Configure MiniMax usage tracking as usual (API key redacted).
  2. Run openclaw status --usage.

Tests

  • pnpm test src/infra/provider-usage.fetch.minimax.test.ts

Risks and Mitigations

  • Risk: If any environment depended on the previous host, usage fetch could change behavior.
    • Mitigation: The new host matches the documented/working endpoint; unit test now locks the URL + method.

Changed files

  • extensions/minimax/provider-registration.ts (modified, +7/-1)
  • src/infra/provider-usage.fetch.minimax.test.ts (modified, +20/-1)
  • src/infra/provider-usage.fetch.minimax.ts (modified, +12/-1)

Code Example

# GET - works, returns usage data
curl -s -X GET -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" \
  https://api.minimax.io/v1/api/openplatform/coding_plan/remains
# Response: {"model_remains":[{"start_time":...,"end_time":...,"remains_time":43}]}

# POST - returns 404
curl -s -X POST -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" \
  https://api.minimax.io/v1/api/openplatform/coding_plan/remains
# Response: 404 page not found
RAW_BUFFERClick to expand / collapse

Bug Description

The MiniMax usage tracker endpoint GET /v1/api/openplatform/coding_plan/remains requires an HTTP GET request, but OpenClaw calls it with POST, resulting in a 404 error.

Steps to Reproduce

  1. Configure MiniMax with a valid API key (MINIMAX_API_KEY)
  2. Run openclaw status --usage
  3. MiniMax usage shows: cookie is missing, log in again

Root Cause

The fetchMinimaxUsage() function in src/infra/provider-usage.fetch.minimax.ts calls the /coding_plan/remains endpoint using POST, but this endpoint:

  • Accepts GET requests (returns {"model_remains":[...]})
  • Returns 404 for POST requests

Verification

Tested with curl:

# GET - works, returns usage data
curl -s -X GET -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" \
  https://api.minimax.io/v1/api/openplatform/coding_plan/remains
# Response: {"model_remains":[{"start_time":...,"end_time":...,"remains_time":43}]}

# POST - returns 404
curl -s -X POST -H "Authorization: Bearer <API_KEY>" -H "Content-Type: application/json" \
  https://api.minimax.io/v1/api/openplatform/coding_plan/remains
# Response: 404 page not found

Expected Behavior

The usage tracker should call the endpoint with GET instead of POST, and it will return valid remaining quota data.

Additional Note

The endpoint only returns remains_time (remaining minutes per window), not consumed quota or percentages. This is a MiniMax API limitation — the response does not include total allocation size.

Environment

  • OpenClaw: 2026.4.5
  • MiniMax: international coding plan ($40 highspeed)
  • OS: macOS

extent analysis

TL;DR

Change the HTTP request method from POST to GET in the fetchMinimaxUsage() function to fix the 404 error.

Guidance

  • Verify that the fetchMinimaxUsage() function in src/infra/provider-usage.fetch.minimax.ts is indeed using the POST method and update it to use the GET method instead.
  • Test the updated function using a tool like curl to ensure it returns the expected usage data.
  • Review the MiniMax API documentation to confirm that the /coding_plan/remains endpoint only supports GET requests.
  • Consider adding error handling to the fetchMinimaxUsage() function to handle potential API errors or changes in the future.

Example

// src/infra/provider-usage.fetch.minimax.ts
function fetchMinimaxUsage() {
  // Update the request method from POST to GET
  return fetch('https://api.minimax.io/v1/api/openplatform/coding_plan/remains', {
    method: 'GET',
    headers: {
      Authorization: `Bearer ${MINIMAX_API_KEY}`,
      'Content-Type': 'application/json',
    },
  });
}

Notes

The fix assumes that the fetchMinimaxUsage() function is the only place where the POST request is being made. If there are other parts of the code making similar requests, they may also need to be updated.

Recommendation

Apply the workaround by updating the fetchMinimaxUsage() function to use the GET method, as this is a straightforward fix that should resolve the 404 error.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING