openclaw - 💡(How to fix) Fix [Feature Request] Add config option to disable model pricing fetch + support Chinese LLM subscription plans [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#73124Fetched 2026-04-28 06:27:16
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Participants
RAW_BUFFERClick to expand / collapse

Problem Description

When OpenClaw Gateway starts (or periodically during runtime), it attempts to fetch model pricing data from two external sources:

  1. OpenRouter - https://openrouter.ai/api/v1/models
  2. LiteLLM - https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json

These network requests timeout after 60 seconds in mainland China due to network connectivity issues to these overseas endpoints. This generates warning logs on every Gateway start:

08:36:17 [model-pricing] OpenRouter pricing fetch failed (timeout 60s): TimeoutError: The operation was aborted due to timeout 08:36:17 [model-pricing] LiteLLM pricing fetch failed (timeout 60s): TimeoutError: The operation was aborted due to timeout

While these are warnings (not fatal errors), they:

  • Clutter logs on every Gateway restart
  • Cause unnecessary network latency during startup
  • Provide no value to users who do not use OpenRouter/LiteLLM

Feature Request

1. Add a config option to disable model pricing fetch

Add a config field like models.pricing.enabled: false to allow users to disable the pricing catalog fetch entirely.

2. Add native support for Chinese LLM API providers

Many Chinese LLM providers offer Coding Plan or Token Plan subscription models that do not fit the traditional per-token pricing paradigm. Examples include:

These providers typically:

  • Offer fixed monthly/annual plans with API call quotas
  • Have different rate limits and quota tracking APIs
  • Do not expose per-token pricing in the same format as OpenRouter

3. Improve pricing data handling for subscription plans

For providers with Coding Plan / Token Plan:

  • Add a plan or quota type to the pricing model
  • Support quota tracking via provider-specific APIs
  • Make the pricing fetch optional per-provider instead of global

Technical Details

Source file: dist/usage-format-*.js in the OpenClaw npm package

Key constants:

  • FETCH_TIMEOUT_MS = 60000 (hardcoded, cannot be configured)
  • CACHE_TTL_MS = 1440 * 6e4 (24 hours)

The pricing refresh is started unconditionally in startGatewayModelPricingRefresh() and there is currently no config option to disable it.

Suggested Implementation Priority

  1. High: Add models.pricing.enabled: false config option to disable the fetch
  2. Medium: Add MiniMax Token Plan API support for quota tracking
  3. Medium: Add support for other Chinese LLM providers' plan APIs
  4. Low: Add per-provider source toggle

Environment: Windows, OpenClaw latest version, MiniMax Token Plan user

extent analysis

TL;DR

Add a configuration option to disable model pricing fetch to prevent timeouts and improve startup performance.

Guidance

  • Introduce a models.pricing.enabled config field to allow users to disable the pricing catalog fetch, reducing network latency and log clutter.
  • Consider adding support for Chinese LLM providers with non-traditional pricing models, such as MiniMax Token Plan, to improve compatibility.
  • Review the hardcoded FETCH_TIMEOUT_MS constant and consider making it configurable to accommodate different network environments.
  • Evaluate the priority of implementing per-provider source toggles to further enhance flexibility.

Example

No code snippet is provided as the issue does not contain sufficient technical details to create a specific example.

Notes

The suggested implementation priorities should be considered when addressing the issue, with the models.pricing.enabled config option being the highest priority.

Recommendation

Apply workaround: Add a models.pricing.enabled config option to disable the fetch, as it is a high-priority task and can immediately address the timeout issues and log clutter.

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

openclaw - 💡(How to fix) Fix [Feature Request] Add config option to disable model pricing fetch + support Chinese LLM subscription plans [1 participants]