Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

FreeRide Prefix Fix - Free AI for OpenClaw

v1.0.8

Fixes OpenClaw's OpenRouter model prefix routing bug for reliable automatic fallback switching using free AI models with proper prefixes.

0· 103· 3 versions· 1 current· 1 all-time· Updated 3w ago· MIT-0

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

CommandWhen to use it
freeride-fix autoAuto-select best free model (most common)
freeride-fix auto -fAdd fallbacks only, keep current primary
freeride-fix auto -c 10More fallbacks (default: 5)
freeride-fix listList available free models
freeride-fix list -n 30Show more models
freeride-fix switch <model>Switch to a specific model
freeride-fix switch <model> -fAdd as fallback only
freeride-fix statusCheck current config
freeride-fix fallbacksUpdate fallback models
freeride-fix refreshRefresh 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

ProblemFix
freeride-fix: command not foundcd skills/free-ride-prefix-fix && pip install -e .
OPENROUTER_API_KEY not setGet a free key at https://openrouter.ai/keys
Changes not taking effectopenclaw gateway restart then /new

Attribution

  • Original author: Shaishav Pidadi (FreeRide)
  • License: MIT (unchanged from original)
  • Fix by: rongtianhua (2026-04-01)

Version tags

latestvk972f5n6sjbez2gkvk3334dcdh848j95