Install
openclaw skills install ai-config-adminManage AI configuration for OpenClaw, OpenCode, Codex CLI, and Claude Code. Use when the user wants to add/remove models or providers, switch default or agent models, replace or update OpenClaw/OpenCode/Codex/Claude config files, or convert natural-language / irregular JSON / TOML input into the exact config changes supported by the bundled scripts. Triggers include: openclaw.json, opencode.json, config.toml, auth.json, settings.json, Claude Code, Codex CLI, provider, model, default model, agent model, OPENAI_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL.
openclaw skills install ai-config-adminIdentify which target the user wants to modify first: OpenClaw, OpenCode, Codex CLI, or Claude Code. Then use the bundled script for that target.
apiKey, OPENAI_API_KEY, ANTHROPIC_AUTH_TOKEN, tokens, or refresh tokens in replies.~/.openclaw/openclaw.json~/.config/opencode/opencode.json~/.codex/config.toml, ~/.codex/auth.json~/.claude/settings.jsonopenclaw.json, default model, agent model, add/remove provider, add/remove model, memory search.opencode.json, OpenCode config, replace full JSON.config.toml, auth.json, Codex CLI, model_provider, review_model, wire_api, requires_openai_auth.settings.json, Claude Code, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, ANTHROPIC_MODEL, CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC, CLAUDE_CODE_ATTRIBUTION_HEADER.add-model to add a model to an existing provider, or to create/update a provider when the user also supplies the required provider fields.add-model needs enough provider config to make it valid: at minimum --base-url and --api; use --api-key and --auth-header when appropriate.add-openai-model only for OpenAI-compatible provider setup flows that require explicit apiKey and api handling in one step.config.toml: infer structured parameters and call the script.auth.json: write only when the user provides a complete JSON payload; default to full replacement.projects, notice, or tui.auth.json contains login-state fields, replace it only when the user explicitly asks for full replacement.settings.json input may be replaced directly.{"env": {...}} fragment:
ANTHROPIC_BASE_URL is present, replace the Claude-related env key set.Use {baseDir} as the skill root.
python3 {baseDir}/scripts/openclaw_config.py --help
python3 {baseDir}/scripts/openclaw_config.py --file ~/.openclaw/openclaw.json summary
python3 {baseDir}/scripts/openclaw_config.py --file ~/.openclaw/openclaw.json add-model \
--provider-id minimax-cn \
--model-id MiniMax-M2.7 \
--name 'MiniMax M2.7' \
--context-window 200000 \
--max-tokens 8192 \
--set-default
Supported operations:
summaryadd-model [--provider-id ...] [--model-id ...] [--name ...] [--context-window ...] [--max-tokens ...] [--reasoning true|false] [--allowlist] [--set-default] [--input text|image ...] [--base-url ...] [--api-key ...] [--api ...] [--auth-header true|false]add-openai-model ...set-openai-provider [--base-url ...] [--api-key ...]remove-model <provider/model>set-memory-search on|offset-default-model <modelId>set-agent-model <agentId> <modelId>remove-provider <providerId>python3 {baseDir}/scripts/opencode_config.py --file ~/.config/opencode/opencode.json summary
python3 {baseDir}/scripts/opencode_config.py --file ~/.config/opencode/opencode.json replace-from-stdin <<'EOF'
{...full JSON...}
EOF
Supported operations:
summaryreplace-from-stdinpython3 {baseDir}/scripts/codex_config.py --help
python3 {baseDir}/scripts/codex_config.py --config-file ~/.codex/config.toml --auth-file ~/.codex/auth.json summary
python3 {baseDir}/scripts/codex_config.py --config-file ~/.codex/config.toml replace-config-from-stdin <<'EOF'
model_provider = "OpenAI"
model = "gpt-5.4"
EOF
python3 {baseDir}/scripts/codex_config.py --auth-file ~/.codex/auth.json replace-auth-from-stdin <<'EOF'
{"OPENAI_API_KEY":"sk-..."}
EOF
Supported operations:
summaryreplace-config-from-stdinreplace-auth-from-stdinset-openai-provider [--model-provider ...] [--model ...] [--review-model ...] [--reasoning-effort ...] [--disable-response-storage true|false] [--network-access ...] [--windows-wsl-setup-acknowledged true|false] [--model-context-window ...] [--model-auto-compact-token-limit ...] [--provider-name ...] [--base-url ...] [--wire-api ...] [--requires-openai-auth true|false]python3 {baseDir}/scripts/claude_config.py --help
python3 {baseDir}/scripts/claude_config.py --file ~/.claude/settings.json summary
python3 {baseDir}/scripts/claude_config.py --file ~/.claude/settings.json set-env \
--anthropic-auth-token 'sk-...' \
--attribution-header '0'
python3 {baseDir}/scripts/claude_config.py --file ~/.claude/settings.json replace-env \
--anthropic-base-url 'https://example.invalid' \
--anthropic-auth-token 'sk-...' \
--attribution-header '0'
python3 {baseDir}/scripts/claude_config.py --file ~/.claude/settings.json replace-from-stdin <<'EOF'
{"env":{"ANTHROPIC_BASE_URL":"https://example.invalid"}}
EOF
Supported operations:
summaryreplace-from-stdinset-env [--anthropic-auth-token ...] [--anthropic-base-url ...] [--anthropic-default-haiku-model ...] [--anthropic-default-opus-model ...] [--anthropic-default-sonnet-model ...] [--anthropic-model ...] [--api-timeout-ms ...] [--disable-nonessential-traffic ...] [--attribution-header ...]replace-env [--anthropic-auth-token ...] [--anthropic-base-url ...] [--anthropic-default-haiku-model ...] [--anthropic-default-opus-model ...] [--anthropic-default-sonnet-model ...] [--anthropic-model ...] [--api-timeout-ms ...] [--disable-nonessential-traffic ...] [--attribution-header ...]headers.User-Agent unless explicitly needed.memorySearch unless the user asks.ANTHROPIC_BASE_URL is present, rebuild the Claude-related env set instead of carrying forward stale provider-specific env/model keys.