add-model-provider
What it does
It walks an AI agent through connecting a new model provider to OpenClaw using setup commands instead of hand-edited files. It is for people who want to run a different AI model in their OpenClaw setup.
When to use it
- ✓When you want to connect a new AI model provider to your OpenClaw setup.
- ✓When you need to check which models and login methods are already set up in OpenClaw.
- ✓When you want a live test to confirm a new model provider works before you rely on it.
Skill link
https://github.com/openclaw/openclaw/blob/main/custodian-skills/add-model-provider/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Help me add a new AI model provider to my OpenClaw and test that it responds.”
5 new skills a week. 1 minute to read.
How it works
The skill checks your current model settings and plugins, then adds the provider with OpenClaw's own commands. Keys are stored as references to a secret source, not as plain text, and the setup ends with a live test.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Add a model provider
Never print or persist secret values; credentials enter config only as SecretRefs (env or file source). Never hand-edit config files on disk — every mutation goes through openclaw config so it is validated and audited. Every run ends with the observable Prove result or an exact explanation of why it could not be proven.
In-session config_set/config_set_ref tool actions are policy-blocked for models.* and secrets.*; use the trusted shell (exec) for the commands below. set_default_model is the one in-session action allowed to change the default route — it live-tests before saving.
Gather
openclaw config get models --json # "Config path not found" is normal before first setup
openclaw models list --agent <agentId> # --agent is required in multi-agent rosters
openclaw models auth list --agent <agentId>
openclaw config schema --json | jq '.properties.models' # confirm exact provider paths before writing
openclaw plugins list # OpenAI routes need the codex harness plugin; enable/install NOW, not mid-proof
If the harness plugin for the target provider is missing or disabled, remediate here (openclaw plugins enable codex or openclaw plugins install @openclaw/codex) so the Prove step does not stall on it later; plugin enable is picked up by gateway hot-reload.
Decide the auth contract: API-key providers take a SecretRef on models.providers.<id>.apiKey; subscription/OAuth providers (ChatGPT/Codex, Claude subscriptions) use openclaw models auth login --provider <id> instead and must not be given an API key path.
Mutate
API-key example (OpenAI), key staged by the operator in a 0600 file — validate first with --dry-run, then write:
openclaw config set secrets.providers.openai_key_file --provider-source file --provider-path /path/to/openai.key --provider-mode singleValue --dry-run
openclaw config set secrets.providers.openai_key_file --provider-source file --provider-path /path/to/openai.key --provider-mode singleValue
openclaw config set models.providers.openai.apiKey --ref-provider openai_key_file --ref-source file --ref-id value
Env-var alternative when the gateway process env carries the key:
openclaw config set models.providers.openai.apiKey --ref-provider default --ref-source env --ref-id OPENAI_API_KEY
To change a default model, use the in-session set_default_model action (with agentId for a non-default agent); it live-tests the route before saving. Do not change defaults with raw config writes.
Repair
openclaw doctor --lint
doctor --lint can exit 1 for findings: read the report and continue the remaining checks. Ordinary doctor and doctor --non-interactive can write config/state; do not use them for diagnosis before approval. If a repair is needed, get explicit approval, run openclaw doctor --fix --non-interactive, then re-run the Gather reads.
Prove
Roster-safe test (works in every setup; use your own agent id or any configured agent):
openclaw agent --agent <agentId> --model openai/gpt-5.4 -m "Reply with exactly: PROVIDER-PROOF-OK"
Single-agent installs can use the lighter completion test instead — it has no --agent flag and fails with "no explicit owner" on multi-agent rosters, so do not retry it there:
openclaw infer model run --gateway --model openai/gpt-5.4 --prompt "Reply with exactly: PROVIDER-PROOF-OK"
Expect the exact requested reply; record model id and wall time. Known dependency: OpenAI routes need the codex harness plugin at runtime — if the test reports the runtime unavailable, run openclaw plugins install @openclaw/codex and restart the gateway, then test again.
Report
State the provider added, the SecretRef path written (never the value), the test result with model id and latency, and whether the default model changed. If the test failed, report the exact error and the next command to try.
Further reference: https://docs.openclaw.ai/providers/models and https://docs.openclaw.ai/providers/openai
FAQ
Will my API key be saved as plain text?
No. The skill stores credentials as references to an environment variable or file, so the secret value is not written into the config.
Why use commands instead of editing the config file?
Commands check each change and keep an audit record, which helps prevent broken settings.
What if a required plugin is missing?
The skill checks for it during setup and turns on or installs the needed plugin before the test runs.
Details
Original description by the author
Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.
repo: openclaw/openclaw
Popularity
- GitHub stars
- 394k
- Ranking position
- #10
- License
- MIT
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
discord-user-post
394kLets your agent post a message you have approved to Discord as you, through the Discord desktop app, after confirming the exact channel.
discrawl
394kLets your agent search and summarize a saved local archive of Discord messages, check how fresh it is, and read direct messages.
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
graincrawl
394kLets your agent search your saved Granola meeting notes and transcripts, check how fresh they are, and count them over a period.
Similar skills
using-superpowers
311kHelps your agent find and use the right skills before it starts a task, so it follows the proven steps for that kind of work.
ask-matt
310kLets your agent act as a guide to a set of coding skills, pointing you to the right one for your situation, from idea to shipped code.
retro
310kLooks back at a coding session and suggests setup changes, such as clearer navigation or automatic checks, so future agent runs go more smoothly.