#is there any approach or command that can satisfy this intension

1 messages · Page 1 of 1 (latest)

empty linden
#
  1. i used this command "openclaw config --section model", completely and sucessfully config an embedded model provider and select the models that i like to use
  2. but after a few days, my api key expired and the provider can't reponse normally anymore
  3. i wanna unset specific model or the whole provider's model config throughly

for custom provider's model config, i need to enter url and key and model-id, if the same situation happens to custom provider, i want to unset all of its related model config too, i wanna know if this is supported by openclaw(i mean if there is any cli that can accomplish this), i only know there is a cli "openclaw config unset" to unset the config with a explicit config path inside the openclaw.json, but i'm worried that if i use openclaw config --section model to successfully config the model, how many config exactly have been updated and added, this is unknown to me, though i know for custom provider it should be two places: openclaw.json's models field and agents fieled, but what if openclaw update its json config update stratege, can i successfully unset the custom providers and its models if this situation occurs?

strange fjordBOT
#

Short answer: partly yes, but not with one single “undo everything --section model touched” command.

On current versions:

  • openclaw config --section model and openclaw configure --section model open the same wizard.
  • The supported non-interactive cleanup path is still openclaw config unset <path>.
  • For saved auth profiles, there is also:
    openclaw infer model auth logout --provider <providerId>
    

For a custom provider, the wizard currently writes mainly to:

  • models.providers.<providerId>
  • agents.defaults.model.primary
  • sometimes agents.defaults.models[provider/model] (alias / per-model params)
#

So the usual cleanup is:

openclaw config unset models.providers.<providerId>
openclaw config unset agents.defaults.model.primary
openclaw config unset 'agents.defaults.models[<providerId>/<modelId>]'

If you want to remove the whole model allowlist:

openclaw config unset agents.defaults.models

Then verify with:

#
openclaw models status

Important nuance: OpenClaw can also get auth from env vars or saved auth state, not just openclaw.json. So if you want it gone thoroughly, also check:

  • env vars like OPENAI_API_KEY, etc.
  • saved auth state:
    openclaw infer model auth status --json
    openclaw infer model auth logout --provider <providerId>
    

Also, don’t treat models.json as the source of truth. Custom providers are derived from config into that file, so remove the config entry first, then re-check openclaw models status.

If you want, paste: