← 返回 Skills 市场
rongtianhua

FreeRide Prefix Fix - Free AI for OpenClaw

作者 rongtianhua · GitHub ↗ · v1.0.8 · MIT-0
cross-platform ⚠ suspicious
103
总下载
0
收藏
1
当前安装
3
版本数
在 OpenClaw 中安装
/install free-ride-prefix-fix
功能描述
Fixes OpenClaw's OpenRouter model prefix routing bug for reliable automatic fallback switching using free AI models with proper prefixes.
使用说明 (SKILL.md)

FreeRide (Prefix Fix) - Free AI for OpenClaw

📌 This is a community fork of the original FreeRide by Shaishav Pidadi.

What's fixed: Model ID prefix routing in the format_model_for_openclaw() function. The original skill wrote fallback model IDs without the openrouter/ routing prefix, causing OpenClaw to fail with "Unknown model" errors. This fork ensures all specific models are prefixed with openrouter/ while preserving the openrouter/free smart router ID.

What This Skill Does

Configures OpenClaw to use free AI models from OpenRouter. Sets the best free model as primary, adds ranked fallbacks so rate limits don't interrupt the user, and preserves existing config.

Prerequisites

  1. OPENROUTER_API_KEY is set:

    export OPENROUTER_API_KEY="sk-or-v1-..."
    # Or persist it:
    openclaw config set env.OPENROUTER_API_KEY "sk-or-v1-..."
    
  2. The freeride-fix CLI is installed:

    cd ~/.openclaw/workspace/skills/free-ride-prefix-fix
    pip install -e .
    

Primary Workflow

# Step 1: Configure best free model + fallbacks
freeride-fix auto

# Step 2: Restart gateway
openclaw gateway restart

Commands Reference

Command When to use it
freeride-fix auto Auto-select best free model (most common)
freeride-fix auto -f Add fallbacks only, keep current primary
freeride-fix auto -c 10 More fallbacks (default: 5)
freeride-fix list List available free models
freeride-fix list -n 30 Show more models
freeride-fix switch \x3Cmodel> Switch to a specific model
freeride-fix switch \x3Cmodel> -f Add as fallback only
freeride-fix status Check current config
freeride-fix fallbacks Update fallback models
freeride-fix refresh Refresh model cache

After any config change, run openclaw gateway restart.

The Bug That Was Fixed

Before (broken):

{
  "primary": "openrouter/qwen/qwen3.6-plus-preview:free",  // ✅ had prefix
  "fallbacks": [
    "openrouter/free",                      // ✅ smart router (ID includes prefix)
    "nvidia/nemotron-3-super-120b-a12b:free"  // ❌ missing openrouter/ prefix!
  ]
}

After (fixed):

{
  "primary": "openrouter/qwen/qwen3.6-plus-preview:free",  // ✅
  "fallbacks": [
    "openrouter/free",                      // ✅ preserved (no double-prefix)
    "openrouter/nvidia/nemotron-3-super-120b-a12b:free"  // ✅ correct routing prefix
  ]
}

Code Change (main.py format_model_for_openclaw)

Original (buggy):

if with_provider_prefix:
    return f"openrouter/{base_id}"
return base_id  # ❌ fallbacks get NO prefix → "Unknown model" error

Fixed:

# openrouter/free is already a fully-qualified router ID, don't double-prefix
if model_id in ("openrouter/free", "openrouter/free:free"):
    return "openrouter/free"

# All other specific models need the routing prefix
# Remove existing prefix first, normalize, then add it back
if base_id.startswith("openrouter/"):
    base_id = base_id[len("openrouter/"):]
if append_free and ":free" not in base_id:
    base_id = f"{base_id}:free"

return f"openrouter/{base_id}"  # ✅ always prefixed (except smart router)

Troubleshooting

Problem Fix
freeride-fix: command not found cd skills/free-ride-prefix-fix && pip install -e .
OPENROUTER_API_KEY not set Get a free key at https://openrouter.ai/keys
Changes not taking effect openclaw gateway restart then /new

Attribution

  • Original author: Shaishav Pidadi (FreeRide)
  • License: MIT (unchanged from original)
  • Fix by: rongtianhua (2026-04-01)
安全使用建议
What to check before installing: - Metadata mismatches: the registry summary said there are no required env vars, but SKILL.md and skill.json require OPENROUTER_API_KEY — plan to supply that key. Also the README/SKILL.md command names (freeride, freeride-fix) do not match setup.py entry_points and skill.json. Expect to run 'pip install -e .' locally and confirm which console script names were installed. - Key auto-detection: the code will try to locate an OpenRouter key in ~/.openclaw/openclaw.json and in ~/.openclaw/agents/*/agent/auth-profiles.json. This is convenient but means the skill will read other agent auth files in your OpenClaw workspace; if you keep secrets there you should be comfortable with this behavior. - Back up your OpenClaw config: the tool modifies ~/.openclaw/openclaw.json (agents.defaults.model and models). Back up that file before running so you can restore your prior configuration if needed. - Review/run locally first: pip-installing from local source is low-risk, but inspect setup.py/entry_points to confirm the console script names and entrypoints. Run the commands with read-only options (e.g., 'freeride list') before 'auto' to see what it would change. - Watcher behavior: the watcher can run continuously and will call the OpenRouter API to test models and rotate configs. Only run it as a daemon if you want automatic rotations and accept periodic API calls. - Source trust: this is a community fork with source included. If you don't trust the uploader, obtain the original upstream repo (author credited) or review the repository history/commit author. The code presented performs expected network and file io for the feature and contains no obvious exfiltration endpoints, but metadata/packaging inconsistencies warrant extra caution. If you want, I can extract the exact console-scripts installed by setup.py, point out the precise lines that read auth-profiles.json, or produce a short checklist of commands to safely test the skill without making persistent config changes.
功能分析
Type: OpenClaw Skill Name: free-ride-prefix-fix Version: 1.0.8 The skill is a utility for managing free OpenRouter models within OpenClaw, specifically fixing a model ID prefix bug found in the original 'FreeRide' skill. It fetches and ranks free models from OpenRouter, updates the local 'openclaw.json' configuration, and includes a 'watcher.py' daemon to automatically rotate models when rate limits are encountered. While the script scans '~/.openclaw/agents/*/agent/auth-profiles.json' to automatically discover OpenRouter API keys, this behavior is aligned with its stated purpose of simplifying configuration and is documented in the changelog.
能力评估
Purpose & Capability
The skill's code (main.py, watcher.py) implements exactly the advertised behavior: it queries OpenRouter, ranks free models, updates ~/.openclaw/openclaw.json, and optionally runs a watcher to rotate models. However, registry-level metadata provided at the top of the report claims 'Required env vars: none' while the SKILL.md and skill.json both require OPENROUTER_API_KEY. Also packaging/CLI name mismatches exist (README/SKILL.md refer to 'freeride-fix' but setup.py/egg-info install console scripts 'freeride' and 'freeride-watcher'; skill.json claims binaries with '-fix' suffix). These inconsistencies are not obviously malicious but are incoherent and could confuse users during install.
Instruction Scope
Runtime instructions tell the user to set OPENROUTER_API_KEY, pip install the package, and restart OpenClaw. The contained code reads/writes only files under the user's ~/.openclaw directory (openclaw.json, watcher and cache/state files) and makes API calls to OpenRouter. That is within the stated purpose (configuring OpenClaw and probing OpenRouter models). One thing to note: get_api_key() intentionally attempts to auto-detect keys by scanning ~/.openclaw/agents/*/agent/auth-profiles.json; this reads other agent auth files to find an OpenRouter key — functionally convenient but sensitive because it reads other stored credentials in the OpenClaw workspace (it filters for provider == 'openrouter').
Install Mechanism
No remote downloads or obscure installers are used. The recommended install is 'pip install -e .' from the skill folder (local editable install) and the package only depends on requests. setup.py and requirements.txt are present. This is a standard, low-risk install mechanism assuming the package source is trusted. The lack of a centralized install spec in the registry (no install field or contradictory guidance) is a packaging/metadata mismatch but not a direct install risk.
Credentials
The skill legitimately needs an OpenRouter API key to call the OpenRouter API; skill.json and SKILL.md declare OPENROUTER_API_KEY as required. The top-level registry metadata saying 'Required env vars: none' is inconsistent and should be corrected. Additionally, the tool will try to auto-detect an OpenRouter key by reading OpenClaw config and auth-profiles in ~/.openclaw/agents/*/agent/auth-profiles.json; while the code filters for provider == 'openrouter', this behavior reads other files that may contain credentials — users should be aware the skill will attempt to find and use keys stored elsewhere in their OpenClaw workspace.
Persistence & Privilege
The skill does not request 'always: true' and is user-invocable only. It writes state/cache files under ~/.openclaw and modifies ~/.openclaw/openclaw.json to change agents.defaults.model/models — which is exactly its purpose. It also provides a watcher that can be run as a daemon (user must start it). Nothing in the package attempts to change other skills or system-wide agent settings outside the stated OpenClaw config path.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install free-ride-prefix-fix
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /free-ride-prefix-fix 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.8
Fix get_api_key() to also scan agent auth-profiles.json for OpenRouter API key. Automatically detects key without manual env var export.
v1.0.0-fix.2
Changed displayName to fix ClawHub font rendering issue for Prefix text (removed parentheses)
v1.0.0-fix.1
Fixed model ID prefix routing bug.
元数据
Slug free-ride-prefix-fix
版本 1.0.8
许可证 MIT-0
累计安装 1
当前安装数 1
历史版本数 3
常见问题

FreeRide Prefix Fix - Free AI for OpenClaw 是什么?

Fixes OpenClaw's OpenRouter model prefix routing bug for reliable automatic fallback switching using free AI models with proper prefixes. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 103 次。

如何安装 FreeRide Prefix Fix - Free AI for OpenClaw?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install free-ride-prefix-fix」即可一键安装,无需额外配置。

FreeRide Prefix Fix - Free AI for OpenClaw 是免费的吗?

是的,FreeRide Prefix Fix - Free AI for OpenClaw 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

FreeRide Prefix Fix - Free AI for OpenClaw 支持哪些平台?

FreeRide Prefix Fix - Free AI for OpenClaw 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 FreeRide Prefix Fix - Free AI for OpenClaw?

由 rongtianhua(@rongtianhua)开发并维护,当前版本 v1.0.8。

💬 留言讨论