openclaw - 💡(How to fix) Fix Support OpenRouter provider routing / extra_body in model config [1 comments, 2 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#77892Fetched 2026-05-06 06:19:40
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
2
Timeline (top)
closed ×1commented ×1

Fix Action

Workaround

Setting account-wide Default Provider Preferences in the OpenRouter dashboard works, but is not granular per model.

Code Example

"models": {
  "openrouter/deepseek/deepseek-v4-pro": {
    "openrouter": {
      "provider": {
        "order": ["GMICloud", "AtlasCloud", "Parasail"],
        "ignore": ["Together"],
        "allow_fallbacks": false
      }
    }
  }
}

---

"models": {
  "openrouter/deepseek/deepseek-v4-pro": {
    "extra_headers": {
      "X-Title-Preset": "deepseek-v4-pro-trusted"
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

agents.defaults.models in openclaw.json currently acts only as an allowlist – the values (objects) in the model map are ignored. There is no way to pass OpenRouter's provider routing preferences (order, ignore, allow_fallbacks, data_collection) or OpenRouter Presets (X-Title-Preset header) through the config.

Use Case

I want to restrict which OpenRouter providers serve a specific model. For example:

  • Allow only: Together, GMICloud, AtlasCloud, Parasail
  • Deny: SiliconFlow, NovitaAI

OpenRouter supports this natively via the provider object in the request body and via Presets (X-Title-Preset header), but OpenClaw has no config key to forward these.

Proposed Solution

Option A – Support an options or extra_body sub-key on model entries:

"models": {
  "openrouter/deepseek/deepseek-v4-pro": {
    "openrouter": {
      "provider": {
        "order": ["GMICloud", "AtlasCloud", "Parasail"],
        "ignore": ["Together"],
        "allow_fallbacks": false
      }
    }
  }
}

Option B – Allow setting extra_headers per provider/model to support Presets:

"models": {
  "openrouter/deepseek/deepseek-v4-pro": {
    "extra_headers": {
      "X-Title-Preset": "deepseek-v4-pro-trusted"
    }
  }
}

Workaround

Setting account-wide Default Provider Preferences in the OpenRouter dashboard works, but is not granular per model.

extent analysis

TL;DR

To restrict OpenRouter providers for specific models in OpenClaw, consider adding an options or extra_body sub-key to model entries in openclaw.json to pass provider preferences.

Guidance

  • Evaluate Option A by adding an openrouter object with a provider sub-key to model entries, specifying order, ignore, and allow_fallbacks preferences.
  • Assess Option B by adding an extra_headers object to model entries, setting the X-Title-Preset header to support Presets.
  • Verify the effectiveness of these options by testing model requests with restricted providers.
  • If the proposed solutions are not feasible, use the account-wide Default Provider Preferences in the OpenRouter dashboard as a temporary workaround, although it lacks model-level granularity.

Example

"models": {
  "openrouter/deepseek/deepseek-v4-pro": {
    "openrouter": {
      "provider": {
        "order": ["GMICloud", "AtlasCloud", "Parasail"],
        "ignore": ["SiliconFlow", "NovitaAI"],
        "allow_fallbacks": false
      }
    }
  }
}

Notes

The proposed solutions require updates to the openclaw.json configuration file and may need adjustments based on the specific OpenClaw and OpenRouter versions being used.

Recommendation

Apply workaround: Use Option A or Option B to add provider preferences to model entries, as it provides a more granular control over OpenRouter providers compared to the account-wide default preferences.

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 Support OpenRouter provider routing / extra_body in model config [1 comments, 2 participants]