{"id":231,"date":"2026-03-21T22:47:23","date_gmt":"2026-03-21T14:47:23","guid":{"rendered":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/providers-openrouter\/"},"modified":"2026-03-21T23:08:51","modified_gmt":"2026-03-21T15:08:51","slug":"providers-openrouter","status":"publish","type":"post","link":"https:\/\/pa.yingzhi8.cn\/index.php\/2026\/03\/21\/providers-openrouter\/","title":{"rendered":"OpenRouter"},"content":{"rendered":"<h1>OpenRouter<\/h1>\n<p>OpenRouter \u63d0\u4f9b\u4e00\u4e2a<strong>\u7edf\u4e00 API<\/strong>\uff0c\u53ef\u901a\u8fc7\u5355\u4e2a<br \/>\n\u7aef\u70b9\u548c API key \u5c06\u8bf7\u6c42\u8def\u7531\u5230\u8bb8\u591a\u6a21\u578b\u3002\u5b83\u4e0e OpenAI \u517c\u5bb9\uff0c\u56e0\u6b64\u5927\u591a\u6570 OpenAI SDK \u53ea\u9700\u5207\u6362 base URL \u5373\u53ef\u4f7f\u7528\u3002<\/p>\n<h2>CLI \u8bbe\u7f6e<\/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 onboard &#8211;auth-choice apiKey &#8211;token-provider openrouter &#8211;token &#8220;$OPENROUTER_API_KEY&#8221;<\/p>\n<pre><code>\n## \u914d\u7f6e\u7247\u6bb5\n\n```json5  theme={&quot;theme&quot;:{&quot;light&quot;:&quot;min-light&quot;,&quot;dark&quot;:&quot;min-dark&quot;}}\n{\n  env: { OPENROUTER_API_KEY: &quot;sk-or-...&quot; },\n  agents: {\n    defaults: {\n      model: { primary: &quot;openrouter\/anthropic\/claude-sonnet-4-5&quot; },\n    },\n  },\n}\n<\/code><\/pre>\n<h2>\u8bf4\u660e<\/h2>\n<ul>\n<li>\u6a21\u578b\u5f15\u7528\u683c\u5f0f\u4e3a <code>openrouter\/&lt;provider&gt;\/&lt;model&gt;<\/code>\u3002<\/li>\n<li>\u5173\u4e8e\u66f4\u591a\u6a21\u578b\/\u63d0\u4f9b\u5546\u9009\u9879\uff0c\u8bf7\u53c2\u9605 <a href=\"\/concepts\/model-providers\">\/concepts\/model-providers<\/a>\u3002<\/li>\n<li>OpenRouter \u5728\u5e95\u5c42\u4f7f\u7528\u5e26\u6709\u4f60\u7684 API key \u7684 Bearer token\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>OpenRouter OpenRouter \u63d0\u4f9b\u4e00\u4e2a\u7edf\u4e00 API\uff0c\u53ef\u901a\u8fc7\u5355\u4e2a \u7aef\u70b9\u548c API key \u5c06\u8bf7\u6c42\u8def [&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-231","post","type-post","status-publish","format-standard","hentry","category-docs"],"_links":{"self":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/231","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=231"}],"version-history":[{"count":1,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/231\/revisions"}],"predecessor-version":[{"id":526,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/posts\/231\/revisions\/526"}],"wp:attachment":[{"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/media?parent=231"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/categories?post=231"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pa.yingzhi8.cn\/index.php\/wp-json\/wp\/v2\/tags?post=231"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}