#Openclaw Config Broken

1 messages · Page 1 of 1 (latest)

shrewd apex
#

PS C:\Users\juand> openclaw onboard
Invalid config at C:\Users\juand.openclaw\openclaw.json:\n- models.providers.openrouter.models: Invalid input: expected array, received undefined

  • models.providers.openrouter: Unrecognized key: "enabled"
    Invalid config at C:\Users\juand.openclaw\openclaw.json:\n- models.providers.openrouter.models: Invalid input: expected array, received undefined
  • models.providers.openrouter: Unrecognized key: "enabled"
covert bluffBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

glacial flameBOT
#

This looks like a stale/manual OpenRouter config block.

Please paste your version first:

openclaw --version

Then try removing the invalid provider override:

openclaw config unset models.providers.openrouter
openclaw config validate
openclaw onboard --auth-choice openrouter-api-key

If config unset also fails because the config can’t load, back up and edit manually:

#
Copy-Item "$env:USERPROFILE\.openclaw\openclaw.json" "$env:USERPROFILE\.openclaw\openclaw.json.bak"
notepad "$env:USERPROFILE\.openclaw\openclaw.json"

Delete the whole models.providers.openrouter block. enabled is not valid there, and OpenRouter is already a bundled provider — normal config is basically just the API key + default model (openrouter/auto).

Docs:

shrewd apex
#

OpenClaw 2026.4.12 (1c0672b)

glacial flameBOT
#

Got it — 2026.4.12 is old enough that I’d clean the config, then update.

The immediate break is this block in:

C:\Users\juand\.openclaw\openclaw.json

Remove the whole:

models: {
  providers: {
    openrouter: { ... }
  }
}
#

or at least remove enabled and add a valid models: [], but better: delete the OpenRouter provider override entirely. OpenRouter is bundled now.

Safe steps:

Copy-Item "$env:USERPROFILE\.openclaw\openclaw.json" "$env:USERPROFILE\.openclaw\openclaw.json.bak"
notepad "$env:USERPROFILE\.openclaw\openclaw.json"

Then:

openclaw config validate
openclaw doctor --repair
iwr -useb https://openclaw.ai/install.ps1 | iex
openclaw onboard --auth-choice openrouter-api-key
shrewd apex
#

config invalid keeps showing up

glacial flameBOT
#

Yep — that means OpenClaw is still reading the same bad block from:

C:\Users\juand\.openclaw\openclaw.json

Fastest fix, since you’re still onboarding: move the broken config aside and let onboarding recreate it:

Move-Item "$env:USERPROFILE\.openclaw\openclaw.json" "$env:USERPROFILE\.openclaw\openclaw.json.bad"
openclaw onboard --auth-choice openrouter-api-key

That’s reversible — your old file is saved as openclaw.json.bad.

If you want to preserve the existing config instead, open it:

#
notepad "$env:USERPROFILE\.openclaw\openclaw.json"

and delete the entire models.providers.openrouter block. Don’t leave:

enabled: true

inside models.providers.openrouter; that key is invalid there.

shrewd apex
#

so what do i do here

},
"hooks": {
"internal": {
"enabled": true,
"entries": {
"session-memory": {
"enabled": true
}
}
}
},
"env": {
"vars": {
"OPENROUTER_API_KEY": ""
}
}
}

glacial flameBOT
#

You’re right at the end of the config — the broken part is above that, before "hooks".

Do this:

  1. In Notepad, search for:
"openrouter"
  1. Delete the whole openrouter block under models.providers.

If your file looks like this:

"models": {
#
  "providers": {
    "openrouter": {
      "enabled": true
    }
  }
},
"hooks": {

change it to:

"hooks": {

So basically remove the entire "models": { ... }, block if it only contains OpenRouter.

#
  1. Save, then run:
openclaw config validate
openclaw onboard --auth-choice openrouter-api-key

Also: this part has an empty key:

"OPENROUTER_API_KEY": ""

That won’t authenticate. You can either put your real key there, or delete that env section and let onboarding ask for the key.

shrewd apex
#

"models": {
"mode": "merge",
"providers": {
"openrouter": {
"enabled": true,
"baseUrl": "https://openrouter.ai/api/v1",
"api": "openai-responses"
}
}
},
"auth": {
"profiles": {
"openrouter/minimax/minimax-m2.5:free": {
"provider": "openrouter",
"mode": "api_key",
"email": "juandaflorezvlogs@gmail.com"
},
"openrouter:default": {
"provider": "openrouter",
"mode": "api_key"
}
}
},

glacial flameBOT
#

Yep, that’s the broken bit. Replace this whole block:

"models": {
  "mode": "merge",
  "providers": {
    "openrouter": {
      "enabled": true,
      "baseUrl": "https://openrouter.ai/api/v1",
      "api": "openai-responses"
    }
  }
},

with just:

#
"models": {
  "mode": "merge"
},

Or delete the entire "models" block if nothing else is inside it.

Keep your "auth" block below it for now.

Then save and run:

openclaw config validate
openclaw onboard --auth-choice openrouter-api-key
#

The problem is specifically:

"enabled": true

doesn’t belong under models.providers.openrouter, and custom provider entries require a models: [...] array. But for OpenRouter you don’t need this override at all — OpenClaw already has OpenRouter bundled.

Also: don’t paste API keys here if it asks later. 🦐

shrewd apex
#

is this good

},
"models": {
"mode": "merge",
}
}
},
"auth": {
"profiles": {
"openrouter/minimax/minimax-m2.5:free": {
"provider": "openrouter",
"mode": "api_key",
"email": "juandaflorezvlogs@gmail.com"
},
"openrouter:default": {
"provider": "openrouter",
"mode": "api_key"
}

glacial flameBOT
#

Not quite — there are too many closing braces and one trailing comma.

This part:

"models": {
  "mode": "merge",
    }
  }
},
"auth": {

should be exactly:

#
"models": {
  "mode": "merge"
},
"auth": {

So remove the extra:

    }
  }

and remove the comma after "merge".

Then make sure the auth block later closes like this:

#
"openrouter:default": {
  "provider": "openrouter",
  "mode": "api_key"
}

followed by:

    }
  },

If it’s still messy, honestly the cleanest path is:

#
Move-Item "$env:USERPROFILE\.openclaw\openclaw.json" "$env:USERPROFILE\.openclaw\openclaw.json.bad"
openclaw onboard --auth-choice openrouter-api-key

That avoids hand-editing JSON entirely.

shrewd apex
#

like this

"models": {
"mode": "merge"
},
"auth": {
"profiles": {
"openrouter:default": {
"provider": "openrouter",
"mode": "api_key"
}
}
},

glacial flameBOT
#

Yes — that part is shaped correctly now. ✅

Now save the file and run:

openclaw config validate

If it says valid, continue:

openclaw onboard --auth-choice openrouter-api-key

One note: your "auth" profile doesn’t show the actual key there, so onboarding may still ask for it. That’s fine — just don’t paste the key into Discord.

shrewd apex
#

my agents keep trying to use ai models and providers i dont have active at all

glacial flameBOT
#

Yeah, that’s usually one of three things: default model, fallbacks, or an old session/model override.

If you only want OpenRouter, run these after openclaw config validate passes:

openclaw models set openrouter/auto
openclaw models fallbacks clear
openclaw models image-fallbacks clear
openclaw config set agents.defaults.models '{ "openrouter/auto": {} }' --strict-json --replace
openclaw gateway restart

Important: "models": { "mode": "merge" } is not an “only use these providers” setting. It merges built-in model catalogs. The actual allowlist is:

"agents": {
#
  "defaults": {
    "models": {
      "openrouter/auto": {}
    }
  }
}

Then check what OpenClaw thinks is active:

openclaw models status

If an existing Discord/WebChat session still tries an old model, switch it in that chat with: