openclaw - ✅(Solved) Fix [Bug]: openrouter provider uses wrong base URL (/v1 instead of /api/v1), causing silent "payloads=0" errors [1 pull requests, 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#69646Fetched 2026-04-22 07:49:47
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2labeled ×2commented ×1
<img width="2560" height="587" alt="Image" src="https://github.com/user-attachments/assets/d05bd863-b855-439e-be9f-36604f16add7" />

Error Message

  1. openclaw gateway run --verbose log "payloads=0 — surfacing error to user"

Root Cause

<img width="2560" height="587" alt="Image" src="https://github.com/user-attachments/assets/d05bd863-b855-439e-be9f-36604f16add7" />

Fix Action

Fixed

PR fix notes

PR #69696: fix(openrouter): make base URL normalization case-insensitive and add regression tests

Description (problem / solution / changelog)

Summary

This PR strengthens the OpenRouter base URL normalization introduced in #68574 to handle case-insensitive URL matching and adds regression tests for edge cases.

Changes

  • Make normalizeBaseUrl case-insensitive by adding .toLowerCase() in:
    • extensions/openrouter/provider-catalog.ts
    • extensions/arcee/provider-catalog.ts
    • src/agents/pi-embedded-runner/model.provider-runtime.test-support.ts
  • Add regression tests covering:
    • Uppercase domain variants (e.g., https://OPENROUTER.AI/v1)
    • Already-correct URLs returning undefined (no-op)
    • Non-OpenRouter custom proxies returning undefined (no-op)

Context

Issue #69646 reported that OpenRouter requests were using /v1 instead of /api/v1, causing HTML error responses instead of JSON. The root fix was already landed in #68574 (2026.4.18). This PR tightens the normalization logic and adds coverage to prevent regressions.

Test plan

  • pnpm test extensions/openrouter passes (8 tests)
  • pnpm test extensions/arcee passes (7 tests)
  • pnpm test src/agents/pi-embedded-runner/model.test.ts passes (50 tests)

Fixes #69646

Changed files

  • extensions/arcee/provider-catalog.ts (modified, +1/-1)
  • extensions/openrouter/index.test.ts (modified, +36/-0)
  • extensions/openrouter/provider-catalog.ts (modified, +1/-1)
  • src/agents/pi-embedded-runner/model.provider-runtime.test-support.ts (modified, +2/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

<img width="2560" height="587" alt="Image" src="https://github.com/user-attachments/assets/d05bd863-b855-439e-be9f-36604f16add7" />

Steps to reproduce

  1. setup openrouter as provider
  2. send messange to bot
  3. openclaw gateway run --verbose log "payloads=0 — surfacing error to user"

Expected behavior

return json response

Actual behavior

It's html response, not json

OpenClaw version

OpenClaw 2026.4.15 (041266a)

Operating system

macOS 15.4 / Ubuntu 24.04 / Windows 11

Install method

npm global

Model

openrouter/auto, openrouter/openai/gpt5.4

Provider / routing chain

openrouter

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The issue can be resolved by adjusting the OpenClaw gateway configuration to return JSON responses instead of HTML.

Guidance

  • Verify the OpenClaw gateway configuration to ensure it is set up to return JSON responses.
  • Check the openclaw gateway run command options to see if there is a flag to specify the response format (e.g., --json or --response-format).
  • Review the OpenClaw documentation to see if there are any specific settings or environment variables that need to be set to enable JSON responses.
  • Test the openclaw gateway run command with the --verbose log option to see if it provides any additional information about the response format.

Example

No code snippet is provided as there is no clear indication of the programming language or specific code involved in the issue.

Notes

The issue may be specific to the OpenClaw version (2026.4.15) or the operating system being used. Further investigation into the OpenClaw configuration and documentation may be necessary to resolve the issue.

Recommendation

Apply workaround: Adjust the OpenClaw gateway configuration to return JSON responses. This is recommended as it is likely a configuration issue rather than a version-specific problem, and adjusting the configuration may resolve the issue without requiring an upgrade.

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…

FAQ

Expected behavior

return json response

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 - ✅(Solved) Fix [Bug]: openrouter provider uses wrong base URL (/v1 instead of /api/v1), causing silent "payloads=0" errors [1 pull requests, 1 comments, 2 participants]