openclaw - 💡(How to fix) Fix Support OpenRouter provider routing params (only, order, allow, avoid) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

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#73288Fetched 2026-04-29 06:21:26
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
closed ×1commented ×1

Code Example

{
  "agents": {
    "defaults": {
      "models": {
        "openrouter/deepseek/deepseek-v4-flash": {
          "params": {
            "provider": {
              "order": ["deepseek", "anyscale", "ogether"],
              "avoid": ["openai"]
            }
          }
        }
      }
    }
  }
}
RAW_BUFFERClick to expand / collapse

Feature Request: Pass through OpenRouter provider routing params

What: Support OpenRouter's provider routing parameters in model config.

Why: OpenRouter's API supports a `provider` object in request bodies for intelligent routing:

  • `provider.only` — restrict requests to specific providers
  • `provider.order` — preference-ordered provider list
  • `provider.allow` — allowlist certain providers
  • `provider.avoid` — exclude specific providers

This is critical for optimizing latency/cost. For example, DeepSeek V4 Flash has multiple providers with significantly different throughput and latency characteristics — you should be able to route to the fastest one.

Current behaviour: OpenClaw's model `params` currently only extracts `temperature`, `maxTokens`, and `cacheRetention` (Anthropic-only). The `provider` object is ignored entirely.

Related: See existing issue #13298 (confirming this gap)

Config example (intended behaviour):

{
  "agents": {
    "defaults": {
      "models": {
        "openrouter/deepseek/deepseek-v4-flash": {
          "params": {
            "provider": {
              "order": ["deepseek", "anyscale", "ogether"],
              "avoid": ["openai"]
            }
          }
        }
      }
    }
  }
}

Milestone: Would help to have this in before more users migrate to DeepSeek V4.

extent analysis

TL;DR

Modify the OpenClaw model configuration to parse and pass through OpenRouter provider routing parameters.

Guidance

  • Review the existing model configuration parsing logic to identify where the provider object is being ignored.
  • Update the params extraction to include the provider object and its properties (only, order, allow, avoid).
  • Verify that the updated configuration can correctly pass through the provider object to OpenRouter's API.
  • Test the updated configuration with the provided example to ensure it achieves the intended behavior.

Example

{
  "agents": {
    "defaults": {
      "models": {
        "openrouter/deepseek/deepseek-v4-flash": {
          "params": {
            "temperature": 0.5,
            "maxTokens": 1024,
            "cacheRetention": 3600,
            "provider": {
              "order": ["deepseek", "anyscale", "ogether"],
              "avoid": ["openai"]
            }
          }
        }
      }
    }
  }
}

Notes

The implementation details may vary depending on the specific programming language and framework used in OpenClaw. This guidance assumes that the model configuration is being parsed and passed through to OpenRouter's API in a way that can be modified to include the provider object.

Recommendation

Apply workaround: Update the model configuration parsing logic to include the provider object, as this will allow for more fine-grained control over routing parameters and improve latency and cost optimization.

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 params (only, order, allow, avoid) [1 comments, 2 participants]