{"id":90,"date":"2026-05-07T23:27:11","date_gmt":"2026-05-07T15:27:11","guid":{"rendered":"http:\/\/81.68.81.149\/?p=90"},"modified":"2026-05-07T23:27:12","modified_gmt":"2026-05-07T15:27:12","slug":"%e4%bb%8e%e7%bd%91%e7%bb%9c%e5%9b%b4%e5%9f%8e%e5%88%b0-api-%e8%87%aa%e7%94%b1%ef%bc%9a%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%83%a8%e7%bd%b2-cliproxyapi-newapi-%e5%85%a8%e8%ae%b0%e5%bd%95","status":"publish","type":"post","link":"http:\/\/81.68.81.149\/index.php\/2026\/05\/07\/%e4%bb%8e%e7%bd%91%e7%bb%9c%e5%9b%b4%e5%9f%8e%e5%88%b0-api-%e8%87%aa%e7%94%b1%ef%bc%9a%e6%9c%8d%e5%8a%a1%e5%99%a8%e9%83%a8%e7%bd%b2-cliproxyapi-newapi-%e5%85%a8%e8%ae%b0%e5%bd%95\/","title":{"rendered":"\u4ece\u7f51\u7edc\u201c\u56f4\u57ce\u201d\u5230 API \u81ea\u7531\uff1a\u670d\u52a1\u5668\u90e8\u7f72 CliProxyAPI + NewAPI \u5168\u8bb0\u5f55"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5728\u6784\u5efa AI \u96c6\u6210\u73af\u5883\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e24\u4e2a\u7ec8\u6781\u6311\u6218\uff1a<strong>API \u534f\u8bae\u7684\u8f6c\u6362<\/strong>\u4e0e<strong>\u4e0d\u53ef\u903e\u8d8a\u7684\u7f51\u7edc\u73af\u5883<\/strong>\u3002\u6700\u8fd1\u5728\u670d\u52a1\u5668\u4e0a\u90e8\u7f72 <code>cliproxyapi<\/code> \u548c <code>newapi<\/code> \u65f6\uff0c\u6211\u7ecf\u5386\u4e86\u4e00\u573a\u4ece\u201c\u955c\u50cf\u62c9\u4e0d\u52a8\u201d\u5230\u201c\u94fe\u8def\u5168\u6253\u901a\u201d\u7684\u5b9e\u6218\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e00\u3001 \u6838\u5fc3\u7ec4\u4ef6\u7b80\u4ecb<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>CliProxyAPI<\/strong>\uff1a\u53cd\u5411\u4ee3\u7406openai\u7f51\u9875\uff0c\u662f\u6253\u901a\u751f\u6001\u7684\u5173\u952e\u6865\u6881\u3002<\/li>\n\n\n\n<li><strong>NewAPI<\/strong>\uff1a\u5f3a\u5927\u7684 API \u5206\u53d1\u4e0e\u7ba1\u7406\u9762\u677f\uff0c\u652f\u6301\u591a\u6a21\u578b\u96c6\u6210\u3001\u989d\u5ea6\u63a7\u5236\u53ca\u6e20\u9053\u8c03\u5ea6\u3002<\/li>\n\n\n\n<li><strong>Mihomo (Clash.Meta)<\/strong>\uff1a\u5728\u7f51\u7edc\u53d7\u9650\u73af\u5883\u4e0b\uff0c\u4e3a\u670d\u52a1\u5668\u63d0\u4f9b\u7a33\u5b9a\u3001\u7075\u6d3b\u7684\u51fa\u6d77\u6d41\u91cf\u8c03\u5ea6\u3002<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e8c\u3001 \u7b2c\u4e00\u9053\u574e\uff1a\u7f51\u7edc\u5e7d\u7075\u4e0e Mihomo \u7684\u6551\u573a<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u5c1d\u8bd5\u62c9\u53d6 <code>cliproxyapi<\/code> \u7684 Docker \u955c\u50cf\u65f6\uff0c\u6700\u8ba9\u4eba\u5934\u75bc\u7684\u83ab\u8fc7\u4e8e <code>docker pull<\/code> \u8fdb\u5ea6\u6761\u7eb9\u4e1d\u4e0d\u52a8\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. \u4e3a\u4ec0\u4e48\u9009\u62e9 Mihomo\uff1f<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u76f8\u6bd4\u4e8e\u4f20\u7edf\u7684\u4ee3\u7406\u65b9\u5f0f\uff0cMihomo \u62e5\u6709\u66f4\u5f3a\u7684\u5185\u6838\u652f\u6301\u548c\u5206\u6d41\u7b56\u7565\u3002\u5728\u670d\u52a1\u5668\u4e0a\uff0c\u6211\u4eec\u901a\u8fc7\u5b83\u5efa\u7acb\u4e00\u4e2a\u672c\u5730\u4ee3\u7406\u901a\u9053\uff0c\u89e3\u51b3 Docker \u955c\u50cf\u62c9\u53d6\u53ca\u540e\u7eed API \u8bbf\u95ee\u6d77\u5916\u8282\u70b9\u7684\u7f51\u7edc\u95ee\u9898\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u5b9e\u64cd\u907f\u5751<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3a\u4e86\u8ba9 Docker \u8d70\u4ee3\u7406\uff0c\u6211\u5e76\u6ca1\u6709\u4fee\u6539\u5168\u5c40\u73af\u5883\uff0c\u800c\u662f\u901a\u8fc7\u914d\u7f6e Docker \u670d\u52a1\u7684\u73af\u5883\u53d8\u91cf\u6765\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bash<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u521b\u5efa Docker \u914d\u7f6e\u76ee\u5f55\nmkdir -p \/etc\/systemd\/system\/docker.service.d\n\n# \u914d\u7f6e\u4ee3\u7406\uff08\u5047\u8bbe Mihomo \u76d1\u542c\u5728 7890 \u7aef\u53e3\uff09\ncat &lt;&lt;EOF &gt; \/etc\/systemd\/system\/docker.service.d\/proxy.conf\n&#91;Service]\nEnvironment=\"HTTP_PROXY=http:\/\/127.0.0.1:7890\"\nEnvironment=\"HTTPS_PROXY=http:\/\/127.0.0.1:7890\"\nEOF\n\n# \u91cd\u8f7d\u914d\u7f6e\u5e76\u91cd\u542f\nsystemctl daemon-reload\nsystemctl restart docker\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e09\u3001 \u90e8\u7f72\u53cc\u5b50\u661f\uff1aCliProxyAPI &amp; NewAPI<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\u7f51\u7edc\u95ee\u9898\u540e\uff0c\u540e\u7eed\u7684\u90e8\u7f72\u903b\u8f91\u5c31\u975e\u5e38\u6e05\u6670\u4e86\u3002\u6211\u5efa\u8bae\u4f7f\u7528 <code>docker-compose<\/code> \u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. \u90e8\u7f72 CliProxyAPI<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3b\u8981\u8d1f\u8d23\u5c06\u7279\u5b9a\u7684 API \u8f6c\u4e49\uff0c\u914d\u7f6e\u65f6\u91cd\u70b9\u5728\u4e8e <strong>API_KEY<\/strong> \u7684\u6620\u5c04\u548c\u7aef\u53e3\u7684\u5f00\u653e\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u90e8\u7f72 NewAPI<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">NewAPI \u4f5c\u4e3a\u603b\u63a7\u5236\u53f0\uff0c\u8d1f\u8d23\u63a5\u5165\u521a\u624d\u90e8\u7f72\u597d\u7684 CliProxyAPI \u8282\u70b9\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u67b6\u6784\u601d\u8def\uff1a<\/strong><\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>CliProxyAPI<\/strong> \u8d1f\u8d23\u201c\u5e72\u6d3b\u201d\uff08\u8bf7\u6c42\u6d77\u5916\u6a21\u578b\uff09\u3002<\/li>\n\n\n\n<li><strong>NewAPI<\/strong> \u8d1f\u8d23\u201c\u7ba1\u94b1\u201d\uff08\u6e20\u9053\u5206\u53d1\u3001\u65e5\u5fd7\u8bb0\u5f55\u3001\u591a\u7528\u6237\u7ba1\u7406\uff09\u3002<\/li>\n\n\n\n<li><strong>Mihomo<\/strong> \u8d1f\u8d23\u201c\u94fa\u8def\u201d\uff08\u786e\u4fdd\u6240\u6709\u8bf7\u6c42\u80fd\u987a\u5229\u5230\u8fbe\u76ee\u6807\u670d\u52a1\u5668\uff09\u3002<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u56db\u3001 \u907f\u5751\u6307\u5357\u4e0e\u7ecf\u9a8c\u603b\u7ed3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u6574\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u6709\u51e0\u4e2a\u7ec6\u8282\u6700\u503c\u5f97\u5173\u6ce8\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u7aef\u53e3\u51b2\u7a81<\/strong>\uff1aMihomo\u3001NewAPI \u548c CliProxyAPI \u90fd\u6709\u9ed8\u8ba4\u7aef\u53e3\uff0c\u90e8\u7f72\u524d\u52a1\u5fc5\u68c0\u67e5 <code>netstat -tulnp<\/code>\uff0c\u907f\u514d\u7aef\u53e3\u5360\u7528\u3002<\/li>\n\n\n\n<li><strong>\u5bb9\u5668\u95f4\u901a\u4fe1<\/strong>\uff1a\u5728 Docker \u7f51\u7edc\u4e2d\uff0cNewAPI \u586b\u5199\u6e20\u9053\u5730\u5740\u65f6\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 <code>http:\/\/cliproxyapi:port<\/code>\uff08\u5bb9\u5668\u540d\uff09\uff0c\u524d\u63d0\u662f\u5b83\u4eec\u5728\u540c\u4e00\u4e2a Docker network \u4e0b\u3002<\/li>\n\n\n\n<li><strong>\u5b89\u5168\u52a0\u56fa<\/strong>\uff1a\u66b4\u9732\u5728\u516c\u7f51\u7684 NewAPI \u52a1\u5fc5\u7b2c\u4e00\u65f6\u95f4\u4fee\u6539\u9ed8\u8ba4\u5bc6\u7801\uff0c\u5e76\u5efa\u8bae\u914d\u5408 Nginx \u53cd\u5411\u4ee3\u7406\u5f00\u542f HTTPS\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e94\u3001 \u7ed3\u8bed<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6280\u672f\u6298\u817e\u7684\u4e50\u8da3\u5f80\u5f80\u5c31\u5728\u4e8e\u6b64\uff1a\u9047\u5230\u7f51\u7edc\u5c01\u9501\u65f6\uff0c\u5bfb\u627e\u50cf Mihomo \u8fd9\u6837\u7684\u7834\u5c40\u5de5\u5177\uff1b\u9047\u5230\u534f\u8bae\u4e0d\u901a\u65f6\uff0c\u5229\u7528 CliProxyAPI \u8fdb\u884c\u8f6c\u6362\u3002\u6700\u540e\u901a\u8fc7 NewAPI \u5c06\u4e00\u5207\u5f52\u4e8e\u79e9\u5e8f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e00\u5957\u7ec4\u5408\u62f3\u6253\u4e0b\u6765\uff0c\u4e0d\u4ec5\u89e3\u51b3\u4e86\u4e00\u6b21\u90e8\u7f72\u95ee\u9898\uff0c\u66f4\u662f\u4e00\u6b21\u5bf9 Linux \u7f51\u7edc\u548c API \u67b6\u6784\u7684\u6df1\u5ea6\u68b3\u7406\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u6784\u5efa AI \u96c6\u6210\u73af\u5883\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u7ecf\u5e38\u4f1a\u9047\u5230\u4e24\u4e2a\u7ec8\u6781\u6311\u6218\uff1aAPI \u534f\u8bae\u7684\u8f6c\u6362\u4e0e\u4e0d\u53ef\u903e\u8d8a\u7684\u7f51\u7edc\u73af\u5883\u3002\u6700\u8fd1\u5728\u670d\u52a1 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":93,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-90","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn"],"_links":{"self":[{"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/posts\/90","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/comments?post=90"}],"version-history":[{"count":2,"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/posts\/90\/revisions"}],"predecessor-version":[{"id":92,"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/posts\/90\/revisions\/92"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/media\/93"}],"wp:attachment":[{"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/media?parent=90"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/categories?post=90"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/81.68.81.149\/index.php\/wp-json\/wp\/v2\/tags?post=90"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}