{"id":97,"date":"2026-03-21T22:47:17","date_gmt":"2026-03-21T14:47:17","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-models\/"},"modified":"2026-03-21T23:08:53","modified_gmt":"2026-03-21T15:08:53","slug":"concepts-models","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/concepts-models\/","title":{"rendered":"Models CLI"},"content":{"rendered":"<h1>Models CLI<\/h1>\n<p>\u5173\u4e8e\u51ed\u8bc1\u914d\u7f6e\u8f6e\u6362\u3001\u51b7\u5374\u65f6\u95f4\u4ee5\u53ca\u5b83\u4eec\u5982\u4f55\u4e0e\u56de\u9000\u4ea4\u4e92\uff0c\u8bf7\u53c2\u9605 <a href=\"\/concepts\/model-failover\">\/concepts\/model-failover<\/a>\u3002<br \/>\n\u5feb\u901f\u63d0\u4f9b\u5546\u6982\u89c8 + \u793a\u4f8b\uff1a<a href=\"\/concepts\/model-providers\">\/concepts\/model-providers<\/a>\u3002<\/p>\n<h2>\u6a21\u578b\u9009\u62e9\u7684\u5de5\u4f5c\u65b9\u5f0f<\/h2>\n<p>OpenClaw \u6309\u4ee5\u4e0b\u987a\u5e8f\u9009\u62e9\u6a21\u578b\uff1a<\/p>\n<ol>\n<li><strong>\u4e3b\u6a21\u578b<\/strong>\uff08<code>agents.defaults.model.primary<\/code> \u6216 <code>agents.defaults.model<\/code>\uff09\u3002<\/li>\n<li><code>agents.defaults.model.fallbacks<\/code> \u4e2d\u7684 <strong>\u56de\u9000\u6a21\u578b<\/strong>\uff08\u6309\u987a\u5e8f\uff09\u3002<\/li>\n<li><strong>\u63d0\u4f9b\u5546\u51ed\u8bc1\u6545\u969c\u5207\u6362<\/strong> \u4f1a\u5728\u5355\u4e2a\u63d0\u4f9b\u5546\u5185\u90e8\u53d1\u751f\uff0c\u7136\u540e\u624d\u4f1a\u79fb\u52a8\u5230\u4e0b\u4e00\u4e2a\u6a21\u578b\u3002<\/li>\n<\/ol>\n<p>\u76f8\u5173\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li><code>agents.defaults.models<\/code> \u662f OpenClaw \u53ef\u4f7f\u7528\u7684\u6a21\u578b\u5141\u8bb8\u5217\u8868\/\u76ee\u5f55\uff08\u4ee5\u53ca\u522b\u540d\uff09\u3002<\/li>\n<li><code>agents.defaults.imageModel<\/code> <strong>\u4ec5\u5728<\/strong> \u4e3b\u6a21\u578b\u65e0\u6cd5\u63a5\u53d7\u56fe\u50cf\u65f6\u4f7f\u7528\u3002<\/li>\n<li>\u6bcf\u4e2a\u667a\u80fd\u4f53\u7684\u9ed8\u8ba4\u503c\u53ef\u4ee5\u901a\u8fc7 <code>agents.list[].model<\/code> \u52a0\u4e0a\u7ed1\u5b9a\u6765\u8986\u76d6 <code>agents.defaults.model<\/code>\uff08\u89c1 <a href=\"\/concepts\/multi-agent\">\/concepts\/multi-agent<\/a>\uff09\u3002<\/li>\n<\/ul>\n<h2>\u5feb\u901f\u6a21\u578b\u7b56\u7565<\/h2>\n<ul>\n<li>\u5c06\u4f60\u7684\u4e3b\u6a21\u578b\u8bbe\u7f6e\u4e3a\u4f60\u53ef\u7528\u7684\u3001\u6700\u65b0\u4e00\u4ee3\u4e2d\u6700\u5f3a\u7684\u6a21\u578b\u3002<\/li>\n<li>\u5bf9\u4e8e\u5bf9\u6210\u672c\/\u5ef6\u8fdf\u654f\u611f\u7684\u4efb\u52a1\u548c\u98ce\u9669\u8f83\u4f4e\u7684\u804a\u5929\uff0c\u4f7f\u7528\u56de\u9000\u6a21\u578b\u3002<\/li>\n<li>\u5bf9\u4e8e\u542f\u7528\u4e86\u5de5\u5177\u7684\u667a\u80fd\u4f53\u6216\u4e0d\u53d7\u4fe1\u4efb\u7684\u8f93\u5165\uff0c\u907f\u514d\u4f7f\u7528\u8f83\u65e7\/\u8f83\u5f31\u7684\u6a21\u578b\u5c42\u7ea7\u3002<\/li>\n<\/ul>\n<h2>\u8bbe\u7f6e\u5411\u5bfc\uff08\u63a8\u8350\uff09<\/h2>\n<p>\u5982\u679c\u4f60\u4e0d\u60f3\u624b\u52a8\u7f16\u8f91\u914d\u7f6e\uff0c\u8bf7\u8fd0\u884c\u8bbe\u7f6e\u5411\u5bfc\uff1a<\/p>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw onboard<\/p>\n<pre><code>\n\u5b83\u53ef\u4ee5\u4e3a\u5e38\u89c1\u63d0\u4f9b\u5546\u8bbe\u7f6e\u6a21\u578b + \u51ed\u8bc1\uff0c\u5305\u62ec **OpenAI Code (Codex)**\n\u8ba2\u9605\uff08OAuth\uff09\u548c **Anthropic**\uff08API key \u6216 `claude setup-token`\uff09\u3002\n\n## \u914d\u7f6e\u952e\uff08\u6982\u89c8\uff09\n\n* `agents.defaults.model.primary` \u548c `agents.defaults.model.fallbacks`\n* `agents.defaults.imageModel.primary` \u548c `agents.defaults.imageModel.fallbacks`\n* `agents.defaults.models`\uff08\u5141\u8bb8\u5217\u8868 + \u522b\u540d + \u63d0\u4f9b\u5546\u53c2\u6570\uff09\n* `models.providers`\uff08\u5199\u5165 `models.json` \u7684\u81ea\u5b9a\u4e49\u63d0\u4f9b\u5546\uff09\n\n\u6a21\u578b\u5f15\u7528\u4f1a\u88ab\u89c4\u8303\u5316\u4e3a\u5c0f\u5199\u3002\u50cf `z.ai\/*` \u8fd9\u6837\u7684\u63d0\u4f9b\u5546\u522b\u540d\u4f1a\u88ab\u89c4\u8303\u5316\n\u4e3a `zai\/*`\u3002\n\n\u63d0\u4f9b\u5546\u914d\u7f6e\u793a\u4f8b\uff08\u5305\u62ec OpenCode\uff09\u4f4d\u4e8e\n[\/gateway\/configuration](\/gateway\/configuration#opencode)\u3002\n\n## \u201cModel is not allowed\u201d\uff08\u4ee5\u53ca\u4e3a\u4ec0\u4e48\u56de\u590d\u4f1a\u505c\u6b62\uff09\n\n\u5982\u679c\u8bbe\u7f6e\u4e86 `agents.defaults.models`\uff0c\u5b83\u5c31\u4f1a\u6210\u4e3a `\/model` \u548c\u4f1a\u8bdd\u8986\u76d6\u7684 **\u5141\u8bb8\u5217\u8868**\u3002\u5f53\u7528\u6237\u9009\u62e9\u4e86\u4e0d\u5728\u8be5\u5141\u8bb8\u5217\u8868\u4e2d\u7684\u6a21\u578b\u65f6\uff0c\nOpenClaw \u4f1a\u8fd4\u56de\uff1a\n\n<\/code><\/pre>\n<p>Model &#8220;provider\/model&#8221; is not allowed. Use \/model to list available models.<\/p>\n<pre><code>\n\u8fd9\u4f1a\u5728\u751f\u6210\u6b63\u5e38\u56de\u590d **\u4e4b\u524d** \u53d1\u751f\uff0c\u56e0\u6b64\u6d88\u606f\u53ef\u80fd\u4f1a\u8ba9\u4eba\u89c9\u5f97\n\u5b83\u201c\u6ca1\u6709\u54cd\u5e94\u201d\u3002\u4fee\u590d\u65b9\u6cd5\u662f\uff1a\n\n* \u5c06\u8be5\u6a21\u578b\u6dfb\u52a0\u5230 `agents.defaults.models`\uff0c\u6216\u8005\n* \u6e05\u9664\u5141\u8bb8\u5217\u8868\uff08\u79fb\u9664 `agents.defaults.models`\uff09\uff0c\u6216\u8005\n* \u4ece `\/model list` \u4e2d\u9009\u62e9\u4e00\u4e2a\u6a21\u578b\u3002\n\n\u5141\u8bb8\u5217\u8868\u793a\u4f8b\u914d\u7f6e\uff1a\n\n```json5  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  agent: {\n    model: { primary: &quot;anthropic\/claude-sonnet-4-5&quot; },\n    models: {\n      &quot;anthropic\/claude-sonnet-4-5&quot;: { alias: &quot;Sonnet&quot; },\n      &quot;anthropic\/claude-opus-4-6&quot;: { alias: &quot;Opus&quot; },\n    },\n  },\n}\n<\/code><\/pre>\n<h2>\u5728\u804a\u5929\u4e2d\u5207\u6362\u6a21\u578b\uff08<code>\/model<\/code>\uff09<\/h2>\n<p>\u4f60\u53ef\u4ee5\u5728\u4e0d\u91cd\u542f\u7684\u60c5\u51b5\u4e0b\u4e3a\u5f53\u524d\u4f1a\u8bdd\u5207\u6362\u6a21\u578b\uff1a<\/p>\n<pre><code>\/model\n\/model list\n\/model 3\n\/model openai\/gpt-5.2\n\/model status\n<\/code><\/pre>\n<p>\u8bf4\u660e\uff1a<\/p>\n<ul>\n<li><code>\/model<\/code>\uff08\u4ee5\u53ca <code>\/model list<\/code>\uff09\u662f\u4e00\u4e2a\u7d27\u51d1\u7684\u7f16\u53f7\u9009\u62e9\u5668\uff08\u6a21\u578b\u5bb6\u65cf + \u53ef\u7528\u63d0\u4f9b\u5546\uff09\u3002<\/li>\n<li>\u5728 Discord \u4e0a\uff0c<code>\/model<\/code> \u548c <code>\/models<\/code> \u4f1a\u6253\u5f00\u4e00\u4e2a\u4ea4\u4e92\u5f0f\u9009\u62e9\u5668\uff0c\u5176\u4e2d\u5305\u542b\u63d0\u4f9b\u5546\u548c\u6a21\u578b\u4e0b\u62c9\u83dc\u5355\uff0c\u4ee5\u53ca\u4e00\u4e2a Submit \u6b65\u9aa4\u3002<\/li>\n<li><code>\/model &lt;#&gt;<\/code> \u4f1a\u4ece\u8be5\u9009\u62e9\u5668\u4e2d\u8fdb\u884c\u9009\u62e9\u3002<\/li>\n<li><code>\/model status<\/code> \u662f\u8be6\u7ec6\u89c6\u56fe\uff08\u51ed\u8bc1\u5019\u9009\u9879\uff0c\u4ee5\u53ca\u5728\u5df2\u914d\u7f6e\u65f6\u663e\u793a\u63d0\u4f9b\u5546\u7aef\u70b9 <code>baseUrl<\/code> + <code>api<\/code> \u6a21\u5f0f\uff09\u3002<\/li>\n<li>\u6a21\u578b\u5f15\u7528\u662f\u901a\u8fc7\u6309 <strong>\u7b2c\u4e00\u4e2a<\/strong> <code>\/<\/code> \u8fdb\u884c\u5206\u5272\u6765\u89e3\u6790\u7684\u3002\u8f93\u5165 <code>\/model &lt;ref&gt;<\/code> \u65f6\u8bf7\u4f7f\u7528 <code>provider\/model<\/code>\u3002<\/li>\n<li>\u5982\u679c\u6a21\u578b ID \u672c\u8eab\u5305\u542b <code>\/<\/code>\uff08OpenRouter \u98ce\u683c\uff09\uff0c\u4f60\u5fc5\u987b\u5305\u542b\u63d0\u4f9b\u5546\u524d\u7f00\uff08\u793a\u4f8b\uff1a<code>\/model openrouter\/moonshotai\/kimi-k2<\/code>\uff09\u3002<\/li>\n<li>\u5982\u679c\u4f60\u7701\u7565\u63d0\u4f9b\u5546\uff0cOpenClaw \u4f1a\u5c06\u8f93\u5165\u89c6\u4e3a\u522b\u540d\u6216 <strong>\u9ed8\u8ba4\u63d0\u4f9b\u5546<\/strong> \u7684\u6a21\u578b\uff08\u4ec5\u5728\u6a21\u578b ID \u4e2d\u6ca1\u6709 <code>\/<\/code> \u65f6\u6709\u6548\uff09\u3002<\/li>\n<\/ul>\n<p>\u5b8c\u6574\u547d\u4ee4\u884c\u4e3a\/\u914d\u7f6e\uff1a <a href=\"\/tools\/slash-commands\">Slash commands<\/a>\u3002<\/p>\n<h2>CLI \u547d\u4ee4<\/h2>\n<p>&#8220;`bash  theme={&#8220;theme&#8221;:{&#8220;light&#8221;:&#8221;min-light&#8221;,&#8221;dark&#8221;:&#8221;min-dark&#8221;}}<br \/>\nopenclaw models list<br \/>\nopenclaw models status<br \/>\nopenclaw models set<br \/>\nopenclaw models set-image <\/p>\n<p>openclaw models aliases list<br \/>\nopenclaw models aliases add<br \/>\nopenclaw models aliases remove <\/p>\n<p>openclaw models fallbacks list<br \/>\nopenclaw models fallbacks add<br \/>\nopenclaw models fallbacks remove<br \/>\nopenclaw models fallbacks clear<\/p>\n<p>openclaw models image-fallbacks list<br \/>\nopenclaw models image-fallbacks add<br \/>\nopenclaw models image-fallbacks remove<br \/>\nopenclaw models image-fallbacks clear<\/p>\n<pre><code>\n`openclaw models`\uff08\u65e0\u5b50\u547d\u4ee4\uff09\u662f `models status` \u7684\u5feb\u6377\u65b9\u5f0f\u3002\n\n### `models list`\n\n\u9ed8\u8ba4\u663e\u793a\u5df2\u914d\u7f6e\u7684\u6a21\u578b\u3002\u5e38\u7528\u6807\u5fd7\uff1a\n\n* `--all`\uff1a\u5b8c\u6574\u76ee\u5f55\n* `--local`\uff1a\u4ec5\u672c\u5730\u63d0\u4f9b\u5546\n* `--provider &lt;name&gt;`\uff1a\u6309\u63d0\u4f9b\u5546\u7b5b\u9009\n* `--plain`\uff1a\u6bcf\u884c\u4e00\u4e2a\u6a21\u578b\n* `--json`\uff1a\u673a\u5668\u53ef\u8bfb\u8f93\u51fa\n\n### `models status`\n\n\u663e\u793a\u5df2\u89e3\u6790\u7684\u4e3b\u6a21\u578b\u3001\u56de\u9000\u6a21\u578b\u3001\u56fe\u50cf\u6a21\u578b\uff0c\u4ee5\u53ca\u5df2\u914d\u7f6e\u63d0\u4f9b\u5546\u7684\u51ed\u8bc1\u6982\u89c8\u3002\u5b83\u8fd8\u4f1a\u663e\u793a\u51ed\u8bc1\u5b58\u50a8\u4e2d\u627e\u5230\u7684\u914d\u7f6e\u6587\u4ef6\u7684 OAuth \u8fc7\u671f\u72b6\u6001\n\uff08\u9ed8\u8ba4\u4f1a\u5728 24 \u5c0f\u65f6\u5185\u5230\u671f\u65f6\u8b66\u544a\uff09\u3002`--plain` \u4ec5\u6253\u5370\u5df2\u89e3\u6790\u7684\n\u4e3b\u6a21\u578b\u3002\nOAuth \u72b6\u6001\u59cb\u7ec8\u4f1a\u663e\u793a\uff08\u5e76\u5305\u542b\u5728 `--json` \u8f93\u51fa\u4e2d\uff09\u3002\u5982\u679c\u67d0\u4e2a\u5df2\u914d\u7f6e\u7684\n\u63d0\u4f9b\u5546\u6ca1\u6709\u51ed\u8bc1\uff0c`models status` \u4f1a\u6253\u5370\u4e00\u4e2a **Missing auth** \u90e8\u5206\u3002\nJSON \u5305\u542b `auth.oauth`\uff08\u8b66\u544a\u7a97\u53e3 + \u914d\u7f6e\u6587\u4ef6\uff09\u548c `auth.providers`\n\uff08\u6bcf\u4e2a\u63d0\u4f9b\u5546\u7684\u6709\u6548\u51ed\u8bc1\uff09\u3002\n\u81ea\u52a8\u5316\u573a\u666f\u8bf7\u4f7f\u7528 `--check`\uff08\u7f3a\u5931\/\u5df2\u8fc7\u671f\u65f6\u9000\u51fa\u7801\u4e3a `1`\uff0c\u5373\u5c06\u8fc7\u671f\u65f6\u4e3a `2`\uff09\u3002\n\n\u51ed\u8bc1\u9009\u62e9\u53d6\u51b3\u4e8e\u63d0\u4f9b\u5546\/\u8d26\u53f7\u3002\u5bf9\u4e8e\u59cb\u7ec8\u5728\u7ebf\u7684 Gateway \u7f51\u5173\u4e3b\u673a\uff0cAPI key \u901a\u5e38\u6700\u53ef\u9884\u6d4b\uff1b\u4e5f\u652f\u6301\u8ba2\u9605 token \u6d41\u7a0b\u3002\n\n\u793a\u4f8b\uff08Anthropic setup-token\uff09\uff1a\n\n```bash  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\nclaude setup-token\nopenclaw models status\n<\/code><\/pre>\n<h2>\u626b\u63cf\uff08OpenRouter \u514d\u8d39\u6a21\u578b\uff09<\/h2>\n<p><code>openclaw models scan<\/code> \u4f1a\u68c0\u67e5 OpenRouter \u7684 <strong>\u514d\u8d39\u6a21\u578b\u76ee\u5f55<\/strong>\uff0c\u5e76\u4e14\u53ef\u4ee5<br \/>\n\u9009\u62e9\u6027\u5730\u63a2\u6d4b\u6a21\u578b\u5bf9\u5de5\u5177\u548c\u56fe\u50cf\u7684\u652f\u6301\u3002<\/p>\n<p>\u5173\u952e\u6807\u5fd7\uff1a<\/p>\n<ul>\n<li><code>--no-probe<\/code>\uff1a\u8df3\u8fc7\u5b9e\u65f6\u63a2\u6d4b\uff08\u4ec5\u5143\u6570\u636e\uff09<\/li>\n<li><code>--min-params &lt;b&gt;<\/code>\uff1a\u6700\u5c0f\u53c2\u6570\u89c4\u6a21\uff08\u5341\u4ebf\uff09<\/li>\n<li><code>--max-age-days &lt;days&gt;<\/code>\uff1a\u8df3\u8fc7\u8f83\u65e7\u6a21\u578b<\/li>\n<li><code>--provider &lt;name&gt;<\/code>\uff1a\u63d0\u4f9b\u5546\u524d\u7f00\u7b5b\u9009<\/li>\n<li><code>--max-candidates &lt;n&gt;<\/code>\uff1a\u56de\u9000\u5217\u8868\u5927\u5c0f<\/li>\n<li><code>--set-default<\/code>\uff1a\u5c06 <code>agents.defaults.model.primary<\/code> \u8bbe\u7f6e\u4e3a\u7b2c\u4e00\u4e2a\u9009\u62e9\u9879<\/li>\n<li><code>--set-image<\/code>\uff1a\u5c06 <code>agents.defaults.imageModel.primary<\/code> \u8bbe\u7f6e\u4e3a\u7b2c\u4e00\u4e2a\u56fe\u50cf\u9009\u62e9\u9879<\/li>\n<\/ul>\n<p>\u63a2\u6d4b\u9700\u8981 OpenRouter API key\uff08\u6765\u81ea\u51ed\u8bc1\u914d\u7f6e\u6587\u4ef6\u6216<br \/>\n<code>OPENROUTER_API_KEY<\/code>\uff09\u3002\u5982\u679c\u6ca1\u6709 key\uff0c\u8bf7\u4f7f\u7528 <code>--no-probe<\/code> \u4ec5\u5217\u51fa\u5019\u9009\u9879\u3002<\/p>\n<p>\u626b\u63cf\u7ed3\u679c\u6309\u4ee5\u4e0b\u987a\u5e8f\u6392\u5e8f\uff1a<\/p>\n<ol>\n<li>\u56fe\u50cf\u652f\u6301<\/li>\n<li>\u5de5\u5177\u5ef6\u8fdf<\/li>\n<li>\u4e0a\u4e0b\u6587\u5927\u5c0f<\/li>\n<li>\u53c2\u6570\u6570\u91cf<\/li>\n<\/ol>\n<p>\u8f93\u5165<\/p>\n<ul>\n<li>OpenRouter <code>\/models<\/code> \u5217\u8868\uff08\u7b5b\u9009 <code>:free<\/code>\uff09<\/li>\n<li>\u9700\u8981\u6765\u81ea\u51ed\u8bc1\u914d\u7f6e\u6587\u4ef6\u6216 <code>OPENROUTER_API_KEY<\/code> \u7684 OpenRouter API key\uff08\u89c1 <a href=\"\/help\/environment\">\/environment<\/a>\uff09<\/li>\n<li>\u53ef\u9009\u7b5b\u9009\u5668\uff1a<code>--max-age-days<\/code>\u3001<code>--min-params<\/code>\u3001<code>--provider<\/code>\u3001<code>--max-candidates<\/code><\/li>\n<li>\u63a2\u6d4b\u63a7\u5236\uff1a<code>--timeout<\/code>\u3001<code>--concurrency<\/code><\/li>\n<\/ul>\n<p>\u5728 TTY \u4e2d\u8fd0\u884c\u65f6\uff0c\u4f60\u53ef\u4ee5\u4ea4\u4e92\u5f0f\u9009\u62e9\u56de\u9000\u6a21\u578b\u3002\u5728\u975e\u4ea4\u4e92<br \/>\n\u6a21\u5f0f\u4e0b\uff0c\u4f20\u5165 <code>--yes<\/code> \u4ee5\u63a5\u53d7\u9ed8\u8ba4\u503c\u3002<\/p>\n<h2>\u6a21\u578b\u6ce8\u518c\u8868\uff08<code>models.json<\/code>\uff09<\/h2>\n<p><code>models.providers<\/code> \u4e2d\u7684\u81ea\u5b9a\u4e49\u63d0\u4f9b\u5546\u4f1a\u5199\u5165<br \/>\n\u667a\u80fd\u4f53\u76ee\u5f55\u4e0b\u7684 <code>models.json<\/code>\uff08\u9ed8\u8ba4\u662f <code>~\/.openclaw\/agents\/&lt;agentId&gt;\/agent\/models.json<\/code>\uff09\u3002\u9ed8\u8ba4\u4f1a\u5408\u5e76\u6b64\u6587\u4ef6\uff0c\u9664\u975e\u5c06 <code>models.mode<\/code> \u8bbe\u7f6e\u4e3a <code>replace<\/code>\u3002<\/p>\n<p>\u5339\u914d\u63d0\u4f9b\u5546 ID \u65f6\u7684\u5408\u5e76\u6a21\u5f0f\u4f18\u5148\u7ea7\uff1a<\/p>\n<ul>\n<li>\u667a\u80fd\u4f53 <code>models.json<\/code> \u4e2d\u5df2\u5b58\u5728\u7684\u975e\u7a7a <code>baseUrl<\/code> \u4f18\u5148\u3002<\/li>\n<li>\u667a\u80fd\u4f53 <code>models.json<\/code> \u4e2d\u7684\u975e\u7a7a <code>apiKey<\/code> \u4ec5\u5728\u8be5\u63d0\u4f9b\u5546\u5728\u5f53\u524d\u914d\u7f6e\/\u51ed\u8bc1\u914d\u7f6e\u6587\u4ef6\u4e0a\u4e0b\u6587\u4e2d\u4e0d\u662f SecretRef \u7ba1\u7406\u65f6\u624d\u4f18\u5148\u3002<\/li>\n<li>\u7531 SecretRef \u7ba1\u7406\u7684\u63d0\u4f9b\u5546 <code>apiKey<\/code> \u503c\u4f1a\u4ece\u6e90\u6807\u8bb0\uff08\u73af\u5883\u53d8\u91cf\u5f15\u7528\u4f7f\u7528 <code>ENV_VAR_NAME<\/code>\uff0c\u6587\u4ef6\/exec \u5f15\u7528\u4f7f\u7528 <code>secretref-managed<\/code>\uff09\u5237\u65b0\uff0c\u800c\u4e0d\u662f\u6301\u4e45\u5316\u5df2\u89e3\u6790\u7684 secret\u3002<\/li>\n<li>\u7531 SecretRef \u7ba1\u7406\u7684\u63d0\u4f9b\u5546 header \u503c\u4f1a\u4ece\u6e90\u6807\u8bb0\uff08\u73af\u5883\u53d8\u91cf\u5f15\u7528\u4f7f\u7528 <code>secretref-env:ENV_VAR_NAME<\/code>\uff0c\u6587\u4ef6\/exec \u5f15\u7528\u4f7f\u7528 <code>secretref-managed<\/code>\uff09\u5237\u65b0\u3002<\/li>\n<li>\u667a\u80fd\u4f53\u4e2d\u4e3a\u7a7a\u6216\u7f3a\u5931\u7684 <code>apiKey<\/code>\/<code>baseUrl<\/code> \u4f1a\u56de\u9000\u5230\u914d\u7f6e\u4e2d\u7684 <code>models.providers<\/code>\u3002<\/li>\n<li>\u5176\u4ed6\u63d0\u4f9b\u5546\u5b57\u6bb5\u4f1a\u4ece\u914d\u7f6e\u548c\u89c4\u8303\u5316\u540e\u7684\u76ee\u5f55\u6570\u636e\u4e2d\u5237\u65b0\u3002<\/li>\n<\/ul>\n<p>\u6807\u8bb0\u6301\u4e45\u5316\u4ee5\u6e90\u4e3a\u51c6\uff1aOpenClaw \u4f1a\u6839\u636e\u6d3b\u52a8\u6e90\u914d\u7f6e\u5feb\u7167\uff08\u9884\u89e3\u6790\uff09\u5199\u5165\u6807\u8bb0\uff0c\u800c\u4e0d\u662f\u6839\u636e\u8fd0\u884c\u65f6\u5df2\u89e3\u6790\u7684 secret \u503c\u5199\u5165\u3002<br \/>\n\u8fd9\u9002\u7528\u4e8e OpenClaw \u91cd\u65b0\u751f\u6210 <code>models.json<\/code> \u7684\u6240\u6709\u60c5\u51b5\uff0c\u5305\u62ec\u50cf <code>openclaw agent<\/code> \u8fd9\u6837\u7684\u547d\u4ee4\u9a71\u52a8\u8def\u5f84\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Models CLI \u5173\u4e8e\u51ed\u8bc1\u914d\u7f6e\u8f6e\u6362\u3001\u51b7\u5374\u65f6\u95f4\u4ee5\u53ca\u5b83\u4eec\u5982\u4f55\u4e0e\u56de\u9000\u4ea4\u4e92\uff0c\u8bf7\u53c2\u9605 \/concepts\/model [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-97","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/97","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/comments?post=97"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/97\/revisions"}],"predecessor-version":[{"id":392,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/97\/revisions\/392"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=97"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=97"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=97"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}