{"id":238,"date":"2026-10-02T02:14:08","date_gmt":"2026-10-02T02:14:08","guid":{"rendered":"https:\/\/ntokenx.com\/blog\/index.php\/2026\/10\/02\/roo-code-api\/"},"modified":"2026-10-09T09:47:44","modified_gmt":"2026-10-09T09:47:44","slug":"roo-code-api","status":"publish","type":"post","link":"https:\/\/ntokenx.com\/blog\/index.php\/2026\/10\/02\/roo-code-api\/","title":{"rendered":"Roo Code\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578bAPI\u6559\u7a0b\uff1a\u53c2\u6570\u3001\u9a8c\u8bc1\u4e0e\u505c\u66f4\u98ce\u9669"},"content":{"rendered":"<p><em>\u4f5c\u8005\uff1anTokenX\uff5c\u53d1\u5e03\u65e5\u671f\uff1a2026-10-02\uff5c\u66f4\u65b0\u65e5\u671f\uff1a2026-10-02<\/em><\/p>\n<p>Roo Code\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578bAPI\u6559\u7a0b\u7684\u6838\u5fc3\uff0c\u662f\u5728\u670d\u52a1\u5546\u8bbe\u7f6e\u4e2d\u9009\u62e9 <strong>OpenAI Compatible<\/strong>\uff0c\u6b63\u786e\u586b\u5199 Base URL\u3001API Key \u4e0e\u6a21\u578b ID\uff0c\u518d\u9a8c\u8bc1\u63a5\u53e3\u662f\u5426\u652f\u6301\u539f\u751f\u5de5\u5177\u8c03\u7528\u3002\u9700\u8981\u6ce8\u610f\uff1aRoo Code \u5df2\u505c\u6b62\u5b98\u65b9\u7ef4\u62a4\uff0c\u672c\u6559\u7a0b\u4e3b\u8981\u9762\u5411\u5b58\u91cf\u7528\u6237\u3002<\/p>\n<h2>\u914d\u7f6e\u524d\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f<\/h2>\n<p><strong>\u622a\u81f3 2026 \u5e74 10 \u6708 2 \u65e5\uff0cRoo Code \u5b98\u65b9\u6269\u5c55\u5df2\u7ecf\u505c\u66f4<\/strong>\u3002\u5176\u5b98\u65b9 GitHub \u4ed3\u5e93\u4e8e 2026 \u5e74 5 \u6708 15 \u65e5\u5f52\u6863\u5e76\u8f6c\u4e3a\u53ea\u8bfb\uff0cRoo Code Cloud\u3001Router \u548c\u5b98\u65b9\u6269\u5c55\u4e5f\u5df2\u505c\u6b62\u8fd0\u8425\u3002\u5b58\u91cf\u7248\u672c\u4ecd\u53ef\u80fd\u8fde\u63a5\u7b2c\u4e09\u65b9\u63a5\u53e3\uff0c\u4f46\u4e0d\u518d\u83b7\u5f97\u5e38\u89c4\u517c\u5bb9\u6027\u4e0e\u5b89\u5168\u66f4\u65b0\u3002(<a href=\"https:\/\/github.com\/RooCodeInc\/Roo-Code\/blob\/main\/src\/shared\/modes.ts\">github.com<\/a>)<\/p>\n<p>\u65b0\u9879\u76ee\u66f4\u9002\u5408\u4f18\u5148\u8bc4\u4f30\u4ecd\u5728\u7ef4\u62a4\u7684\u5de5\u5177\uff1b\u5982\u679c\u51c6\u5907\u8fc1\u79fb\uff0c\u53ef\u53c2\u8003 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/30\/cline-third-party-api\/\">Cline \u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3\u6307\u5357<\/a>\u3002\u5fc5\u987b\u7ee7\u7eed\u4f7f\u7528 Roo Code \u65f6\uff0c\u5efa\u8bae\u53ea\u5728\u4e34\u65f6\u4ed3\u5e93\u6216\u975e\u654f\u611f\u4ee3\u7801\u5e93\u4e2d\u6d4b\u8bd5\u3002<\/p>\n<h2>\u9700\u8981\u51c6\u5907\u54ea\u4e9bAPI\u53c2\u6570\uff1f<\/h2>\n<p><strong>\u63a5\u5165\u7b2c\u4e09\u65b9\u6a21\u578b\u81f3\u5c11\u9700\u8981\u4e09\u4e2a\u53c2\u6570\uff1aBase URL\u3001API Key \u548c\u51c6\u786e\u7684\u6a21\u578b ID<\/strong>\u3002\u4ec5\u80fd\u6b63\u5e38\u804a\u5929\u8fd8\u4e0d\u591f\uff0c\u6a21\u578b\u53ca\u7f51\u5173\u8fd8\u5fc5\u987b\u517c\u5bb9 OpenAI \u98ce\u683c\u7684\u539f\u751f Function Calling \u6216 Tool Calling\u3002<\/p>\n<div style=\"overflow-x:auto;\">\n<table style=\"width:100%;border-collapse:collapse;margin:1.5em 0;font-size:0.95em;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u53c2\u6570<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u586b\u5199\u5185\u5bb9<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u5e38\u89c1\u9519\u8bef<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">API Provider<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\"><code>OpenAI Compatible<\/code><\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8bef\u9009\u5b98\u65b9 OpenAI \u63d0\u4f9b\u5546<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Base URL<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u670d\u52a1\u5546\u63d0\u4f9b\u7684\u517c\u5bb9\u63a5\u53e3\u6839\u8def\u5f84<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u586b\u5165\u5b8c\u6574\u7684 <code>\/chat\/completions<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">API Key<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u63a7\u5236\u53f0\u521b\u5efa\u7684\u5bc6\u94a5<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5e26\u7a7a\u683c\u3001\u8fc7\u671f\u6216\u65e0\u6a21\u578b\u6743\u9650<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Model ID<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">API \u5b9e\u9645\u8bc6\u522b\u7684\u6a21\u578b\u540d\u79f0<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u586b\u7f51\u9875\u5c55\u793a\u540d\u6216\u9057\u6f0f\u7248\u672c\u540e\u7f00<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Context Window<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6a21\u578b\u771f\u5b9e\u4e0a\u4e0b\u6587\u4e0a\u9650<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u968f\u610f\u586b\u5199\u8fc7\u5927\u7684\u6570\u503c<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Max Output Tokens<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6700\u5927\u8f93\u51fa\u957f\u5ea6<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8d85\u8fc7\u63a5\u53e3\u9650\u5236\u5bfc\u81f4 400<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5b98\u65b9\u5b58\u6863\u6587\u6863\u663e\u793a\uff0cRoo Code \u8fd8\u5141\u8bb8\u914d\u7f6e\u56fe\u7247\u652f\u6301\u3001\u8ba1\u7b97\u673a\u64cd\u4f5c\u80fd\u529b\u53ca\u8f93\u5165\u8f93\u51fa\u4ef7\u683c\uff1b\u5176\u4e2d\u4ef7\u683c\u5b57\u6bb5\u7528\u4e8e\u672c\u5730\u6210\u672c\u4f30\u7b97\uff0c\u4e0d\u4f1a\u6539\u53d8\u670d\u52a1\u5546\u5b9e\u9645\u8ba1\u8d39\u3002(<a href=\"https:\/\/github.com\/RooCodeInc\/Roo-Code\/blob\/main\/apps\/docs\/docs\/providers\/openai-compatible.md\">github.com<\/a>)<\/p>\n<figure class=\"wp-block-image size-large\" style=\"margin:1.5em 0;\"><img decoding=\"async\" src=\"https:\/\/ntokenx.com\/blog\/wp-content\/uploads\/2026\/10\/backend-4770-1.jpg\" alt=\"Roo Code\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578bAPI\u6559\u7a0b\u53c2\u6570\u793a\u610f\u56fe\" style=\"max-width:100%;height:auto;\"><\/figure>\n<h2>\u5982\u4f55\u5728Roo Code\u4e2d\u914d\u7f6e\u7b2c\u4e09\u65b9API\uff1f<\/h2>\n<p><strong>\u914d\u7f6e\u8def\u5f84\u662f Roo Code \u9762\u677f\u7684\u8bbe\u7f6e\u9875\uff0c\u63a5\u53e3\u7c7b\u578b\u9009\u62e9 OpenAI Compatible<\/strong>\u3002\u4e0d\u540c\u5b58\u91cf\u7248\u672c\u7684\u6309\u94ae\u4f4d\u7f6e\u53ef\u80fd\u7565\u6709\u5dee\u5f02\uff0c\u4f46\u6838\u5fc3\u5b57\u6bb5\u548c\u9a8c\u8bc1\u903b\u8f91\u57fa\u672c\u4e00\u81f4\u3002<\/p>\n<ol>\n<li>\u5728 VS Code \u4e2d\u6253\u5f00 Roo Code \u9762\u677f\u3002<\/li>\n<li>\u70b9\u51fb\u53f3\u4e0a\u89d2\u9f7f\u8f6e\uff0c\u8fdb\u5165\u63d0\u4f9b\u5546\u8bbe\u7f6e\u3002<\/li>\n<li>\u65b0\u5efa\u4e00\u4e2a\u914d\u7f6e\u6863\uff0c\u4f8b\u5982\u201c\u7edf\u4e00\u4ee3\u7801\u6a21\u578b\u201d\u3002<\/li>\n<li>\u5c06 API Provider \u8bbe\u4e3a <code>OpenAI Compatible<\/code>\u3002<\/li>\n<li>\u586b\u5199\u670d\u52a1\u5546\u7ed9\u51fa\u7684 Base URL\uff0c\u4f8b\u5982 <code>https:\/\/api.example.com\/v1<\/code>\u3002<\/li>\n<li>\u7c98\u8d34 API Key\uff0c\u5e76\u8f93\u5165\u51c6\u786e\u7684 Model ID\u3002<\/li>\n<li>\u6309\u6a21\u578b\u771f\u5b9e\u80fd\u529b\u8bbe\u7f6e\u4e0a\u4e0b\u6587\u7a97\u53e3\u3001\u8f93\u51fa\u4e0a\u9650\u548c\u56fe\u7247\u652f\u6301\u3002<\/li>\n<li>\u4fdd\u5b58\u914d\u7f6e\uff0c\u5e76<strong>\u65b0\u5efa\u4efb\u52a1<\/strong>\u8fdb\u884c\u9a8c\u8bc1\u3002<\/li>\n<\/ol>\n<p>Base URL \u5e94\u4ee5\u670d\u52a1\u5546\u6587\u6863\u4e3a\u51c6\uff0c\u4e0d\u8981\u81ea\u884c\u51b3\u5b9a\u662f\u5426\u589e\u52a0 <code>\/v1<\/code>\uff0c\u4e5f\u4e0d\u8981\u628a <code>\/chat\/completions<\/code> \u5f53\u4f5c\u6839\u5730\u5740\u3002\u4f7f\u7528\u7edf\u4e00\u63a5\u53e3\u65f6\uff0c<a href=\"https:\/\/ntokenx.com\/\">nTokenX<\/a> \u652f\u6301\u901a\u8fc7\u4e00\u4e2a API Key \u8c03\u7528 GPT\u3001Claude\u3001Gemini\u3001Grok \u7b49\u591a\u4e2a\u6a21\u578b\uff0c\u5207\u6362\u6a21\u578b\u65f6\u4ecd\u9700\u586b\u5199\u63a5\u53e3\u5b9e\u9645\u8bc6\u522b\u7684 ID\u3002<\/p>\n<figure class=\"wp-block-image size-large\" style=\"margin:1.5em 0;\"><img decoding=\"async\" src=\"https:\/\/ntokenx.com\/blog\/wp-content\/uploads\/2026\/10\/backend-4770-2.jpg\" alt=\"Roo Code\u7b2c\u4e09\u65b9API\u63d0\u4f9b\u5546\u8bbe\u7f6e\u754c\u9762\u793a\u610f\u56fe\" style=\"max-width:100%;height:auto;\"><\/figure>\n<h2>\u5982\u4f55\u9a8c\u8bc1\u914d\u7f6e\u662f\u5426\u771f\u6b63\u53ef\u7528\uff1f<\/h2>\n<p><strong>\u6709\u6548\u9a8c\u8bc1\u5fc5\u987b\u8986\u76d6\u9274\u6743\u3001\u6587\u672c\u751f\u6210\u3001\u5de5\u5177\u8c03\u7528\u548c\u591a\u8f6e\u4efb\u52a1\u56db\u5c42<\/strong>\u3002\u53ea\u770b\u5230\u6a21\u578b\u56de\u590d\u6587\u5b57\uff0c\u4e0d\u80fd\u8bc1\u660e\u5b83\u5177\u5907\u8bfb\u53d6\u6587\u4ef6\u3001\u6267\u884c\u5de5\u5177\u548c\u7ee7\u7eed\u5904\u7406\u7ed3\u679c\u7684\u80fd\u529b\u3002<\/p>\n<p>\u672c\u6587\u91c7\u7528\u539f\u521b\u7684\u201c\u56db\u6bb5\u9a8c\u6536\u6cd5\u201d\uff0c\u6bcf\u9879\u8ba1 1 \u5206\uff0c\u5efa\u8bae\u8fbe\u5230 <strong>4\/4<\/strong> \u540e\u518d\u8fdb\u5165\u771f\u5b9e\u9879\u76ee\uff1a<\/p>\n<div style=\"overflow-x:auto;\">\n<table style=\"width:100%;border-collapse:collapse;margin:1.5em 0;font-size:0.95em;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u6d4b\u8bd5\u9879<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u6d4b\u8bd5\u6307\u4ee4<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u901a\u8fc7\u6807\u51c6<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u9274\u6743<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u53d1\u9001\u4e00\u53e5\u666e\u901a\u95ee\u7b54<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u65e0 401\u3001403 \u9519\u8bef<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6587\u672c<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8981\u6c42\u53ea\u56de\u590d\u201c\u8fde\u63a5\u6210\u529f\u201d<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5185\u5bb9\u5b8c\u6574\uff0c\u65e0\u5f02\u5e38\u622a\u65ad<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5de5\u5177<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8981\u6c42\u8bfb\u53d6\u6839\u76ee\u5f55\u6587\u4ef6\u5217\u8868<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u65f6\u95f4\u7ebf\u51fa\u73b0\u7ed3\u6784\u5316\u5de5\u5177\u8c03\u7528<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u591a\u8f6e<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8bfb\u53d6 README \u540e\u518d\u68c0\u67e5\u914d\u7f6e\u6587\u4ef6<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5de5\u5177\u7ed3\u679c\u80fd\u56de\u4f20\u5e76\u7ee7\u7eed\u63a8\u7406<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5b98\u65b9\u8d44\u6599\u660e\u786e\u6307\u51fa\uff0cRoo Code \u4ec5\u4f7f\u7528\u539f\u751f\u5de5\u5177\u8c03\u7528\uff0c\u6ca1\u6709 XML \u5de5\u5177\u534f\u8bae\u56de\u9000\u3002\u56e0\u6b64\uff0c\u63a5\u53e3\u4ec5\u517c\u5bb9\u666e\u901a\u804a\u5929\u8bf7\u6c42\u4f46\u672a\u5b8c\u6574\u5b9e\u73b0 <code>tools<\/code>\u3001<code>tool_calls<\/code> \u548c\u6d41\u5f0f\u53c2\u6570\u65f6\uff0c\u901a\u5e38\u65e0\u6cd5\u7a33\u5b9a\u6267\u884c\u7f16\u7801\u4efb\u52a1\u3002(<a href=\"https:\/\/github.com\/RooCodeInc\/Roo-Code\/blob\/main\/apps\/docs\/docs\/providers\/openai-compatible.md\">github.com<\/a>)<\/p>\n<h2>\u5e38\u89c1\u9519\u8bef\u5982\u4f55\u6392\u67e5\uff1f<\/h2>\n<p><strong>\u6392\u9519\u987a\u5e8f\u5e94\u4ece URL\u3001\u5bc6\u94a5\u3001\u6a21\u578b ID \u5230\u5de5\u5177\u534f\u8bae\u9010\u5c42\u8fdb\u884c<\/strong>\u3002\u9891\u7e41\u66f4\u6362\u6a21\u578b\u6216\u53cd\u590d\u70b9\u51fb\u91cd\u8bd5\uff0c\u5f80\u5f80\u4f1a\u63a9\u76d6\u771f\u6b63\u7684\u914d\u7f6e\u95ee\u9898\u3002<\/p>\n<div style=\"overflow-x:auto;\">\n<table style=\"width:100%;border-collapse:collapse;margin:1.5em 0;font-size:0.95em;\">\n<thead>\n<tr>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u62a5\u9519\u6216\u73b0\u8c61<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u4e3b\u8981\u539f\u56e0<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u5904\u7406\u65b9\u6cd5<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">401 \/ Invalid API Key<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Key \u65e0\u6548\u6216\u4e0e\u63a5\u53e3\u4e0d\u5339\u914d<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u91cd\u65b0\u590d\u5236\u5e76\u68c0\u67e5\u7a7a\u683c\u3001\u6743\u9650<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">404 Not Found<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Base URL \u8def\u5f84\u9519\u8bef<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u68c0\u67e5\u91cd\u590d\u6216\u7f3a\u5931\u7684 <code>\/v1<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Model Not Found<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6a21\u578b ID \u4e0d\u51c6\u786e<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4ece\u670d\u52a1\u5546\u6a21\u578b\u5217\u8868\u539f\u6837\u590d\u5236<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u666e\u901a\u804a\u5929\u6210\u529f\uff0c\u4efb\u52a1\u5931\u8d25<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e0d\u652f\u6301\u539f\u751f\u5de5\u5177\u8c03\u7528<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u66f4\u6362\u652f\u6301 Function Calling \u7684\u6a21\u578b<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">429 Too Many Requests<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5e76\u53d1\u6216\u9891\u7387\u8d85\u9650<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u964d\u4f4e\u5e76\u53d1\u5e76\u589e\u52a0\u8bf7\u6c42\u95f4\u9694<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5207\u6362\u6a21\u578b\u540e\u4ecd\u8c03\u7528\u65e7\u6a21\u578b<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u65e7\u4efb\u52a1\u4fdd\u7559\u539f\u914d\u7f6e<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u65b0\u5efa\u4efb\u52a1\u6216\u91cd\u8f7d VS Code<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u5982\u679c\u5176\u4ed6\u7f16\u8f91\u5668\u4e5f\u9700\u8981\u540c\u4e00\u63a5\u53e3\uff0c\u53ef\u7ee7\u7eed\u67e5\u770b <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/22\/cursor-custom-openai-compatible-api-tutorial\/\">Cursor \u81ea\u5b9a\u4e49 OpenAI \u517c\u5bb9\u63a5\u53e3\u914d\u7f6e<\/a>\uff0c\u7528\u76f8\u540c\u53c2\u6570\u4ea4\u53c9\u9a8c\u8bc1\u670d\u52a1\u7aef\u517c\u5bb9\u6027\u3002<\/p>\n<h2>\u591a\u6a21\u578b\u7edf\u4e00API\u5e94\u8be5\u600e\u4e48\u9009\uff1f<\/h2>\n<p><strong>\u7edf\u4e00\u5927\u6a21\u578b API \u53ef\u51cf\u5c11\u91cd\u590d\u7ba1\u7406\u5bc6\u94a5\u548c\u63a5\u53e3\u5730\u5740\u7684\u5de5\u4f5c\uff0c\u4f46\u5fc5\u987b\u533a\u5206\u6b63\u89c4\u7f51\u5173\u4e0e\u7b2c\u4e09\u65b9\u6a21\u578b\u4e2d\u8f6c<\/strong>\u3002\u4e24\u8005\u5728\u6388\u6743\u65b9\u5f0f\u3001\u6570\u636e\u6d41\u5411\u548c\u8fd0\u7ef4\u8d23\u4efb\u4e0a\u5e76\u4e0d\u76f8\u540c\u3002<\/p>\n<p>\u6b63\u89c4 API \u805a\u5408\u6216\u7f51\u5173\u901a\u5e38\u7531\u7528\u6237\u7ed1\u5b9a\u81ea\u5df1\u7684\u6a21\u578b\u5382\u5546 Key\uff0c\u5e73\u53f0\u8d1f\u8d23\u7edf\u4e00\u8f6c\u53d1\u3001\u8ba1\u8d39\u4e0e\u76d1\u63a7\uff1b\u7b2c\u4e09\u65b9\u6a21\u578b\u4e2d\u8f6c\u5219\u7531\u5e73\u53f0\u91c7\u8d2d\u6216\u4ee3\u7406\u989d\u5ea6\uff0c\u518d\u63d0\u4f9b\u7edf\u4e00 API\uff0c\u5176\u6388\u6743\u3001\u7a33\u5b9a\u6027\u548c\u6570\u636e\u5b89\u5168\u5dee\u5f02\u8f83\u5927\u3002<\/p>\n<p>\u9009\u62e9\u65f6\u5e94\u6838\u5bf9\u6a21\u578b\u6388\u6743\u3001\u65e5\u5fd7\u4fdd\u7559\u3001\u5bc6\u94a5\u64a4\u9500\u3001\u9650\u6d41\u7b56\u7565\u548c\u6545\u969c\u5207\u6362\u673a\u5236\uff0c\u800c\u4e0d\u662f\u53ea\u770b\u6a21\u578b\u6570\u91cf\u3002\u9700\u8981\u8fdb\u4e00\u6b65\u7406\u89e3\u6a21\u578b\u8def\u7531\uff0c\u53ef\u53c2\u8003 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/11\/openrouter-guide\/\">OpenRouter \u6a21\u578b\u805a\u5408\u4e0e\u63a5\u5165\u6307\u5357<\/a>\u3002<\/p>\n<h2>\u5982\u4f55\u964d\u4f4e\u505c\u66f4\u7248\u672c\u7684\u4f7f\u7528\u98ce\u9669\uff1f<\/h2>\n<p><strong>Roo Code \u80fd\u8bfb\u53d6\u6587\u4ef6\u3001\u4fee\u6539\u4ee3\u7801\u548c\u8fd0\u884c\u7ec8\u7aef\u547d\u4ee4\uff0c\u505c\u66f4\u540e\u5e94\u91c7\u7528\u6700\u5c0f\u6743\u9650\u7b56\u7565<\/strong>\u3002\u4e0d\u8981\u5728\u5305\u542b\u751f\u4ea7\u51ed\u636e\u3001\u5ba2\u6237\u6570\u636e\u6216\u672a\u63d0\u4ea4\u4fee\u6539\u7684\u4ed3\u5e93\u4e2d\u76f4\u63a5\u542f\u7528\u81ea\u52a8\u64cd\u4f5c\u3002<\/p>\n<ul>\n<li>\u9996\u6b21\u6d4b\u8bd5\u5173\u95ed\u81ea\u52a8\u6279\u51c6\uff1b<\/li>\n<li>\u4f7f\u7528 <code>.rooignore<\/code> \u6392\u9664 <code>.env<\/code>\u3001\u8bc1\u4e66\u548c\u5bc6\u94a5\u6587\u4ef6\uff1b<\/li>\n<li>\u6bcf\u6b21\u5199\u64cd\u4f5c\u524d\u5efa\u7acb Git \u63d0\u4ea4\uff1b<\/li>\n<li>\u9010\u6761\u5ba1\u6838\u5220\u9664\u3001\u90e8\u7f72\u548c\u7f51\u7edc\u4e0a\u4f20\u547d\u4ee4\uff1b<\/li>\n<li>\u6d4b\u8bd5\u7ed3\u675f\u540e\u64a4\u9500\u4e34\u65f6 API Key\uff1b<\/li>\n<li>\u4e0d\u4ece\u4e0d\u660e\u955c\u50cf\u4e0b\u8f7d\u6240\u8c13\u201c\u65b0\u7248\u201d\u5b89\u88c5\u5305\u3002<\/li>\n<\/ul>\n<h2>\u5e38\u89c1\u95ee\u9898<\/h2>\n<h3>Roo Code\u8fd8\u80fd\u5b89\u88c5\u548c\u4f7f\u7528\u5417\uff1f<\/h3>\n<p>\u5b58\u91cf\u5b89\u88c5\u53ef\u80fd\u4ecd\u80fd\u8fd0\u884c\uff0c\u4f46\u5b98\u65b9\u6269\u5c55\u548c\u4ed3\u5e93\u5df2\u4e8e 2026 \u5e74 5 \u6708 15 \u65e5\u505c\u6b62\u7ef4\u62a4\u3002\u65b0\u9879\u76ee\u4e0d\u5efa\u8bae\u5c06\u5176\u4f5c\u4e3a\u957f\u671f\u751f\u4ea7\u5de5\u5177\u3002<\/p>\n<h3>Base URL\u9700\u8981\u5305\u542bchat\/completions\u5417\uff1f<\/h3>\n<p>\u901a\u5e38\u4e0d\u9700\u8981\u3002\u591a\u6570 OpenAI \u517c\u5bb9\u63a5\u53e3\u586b\u5199\u5230 <code>\/v1<\/code> \u6216\u670d\u52a1\u5546\u6307\u5b9a\u7684\u7248\u672c\u6839\u8def\u5f84\u5373\u53ef\uff0c\u6700\u7ec8\u4ee5\u670d\u52a1\u5546\u6587\u6863\u4e3a\u51c6\u3002<\/p>\n<h3>\u4e3a\u4ec0\u4e48\u6a21\u578b\u80fd\u804a\u5929\u5374\u4e0d\u80fd\u4fee\u6539\u6587\u4ef6\uff1f<\/h3>\n<p>\u6700\u5e38\u89c1\u539f\u56e0\u662f\u6a21\u578b\u6216\u7f51\u5173\u6ca1\u6709\u5b8c\u6574\u652f\u6301\u539f\u751f\u5de5\u5177\u8c03\u7528\u3002Roo Code \u9700\u8981\u7ed3\u6784\u5316\u7684\u5de5\u5177\u540d\u79f0\u3001JSON \u53c2\u6570\u3001\u5de5\u5177\u7ed3\u679c\u56de\u4f20\u548c\u591a\u8f6e\u8c03\u7528\u3002<\/p>\n<h3>\u4e00\u4e2aAPI Key\u53ef\u4ee5\u5207\u6362\u591a\u4e2a\u6a21\u578b\u5417\uff1f<\/h3>\n<p>\u53ef\u4ee5\uff0c\u4f46\u53d6\u51b3\u4e8e\u670d\u52a1\u5e73\u53f0\u662f\u5426\u63d0\u4f9b\u7edf\u4e00\u6a21\u578b\u8def\u7531\u3002nTokenX \u7684\u4e00\u4e2a API Key \u53ef\u8c03\u7528 GPT\u3001Claude\u3001Gemini\u3001Grok \u7b49\u591a\u4e2a\u6a21\u578b\uff0c\u914d\u7f6e\u65f6\u4ecd\u9700\u4f7f\u7528\u5bf9\u5e94\u7684\u6a21\u578b ID\u3002<\/p>\n<p><script type=\"application\/ld+json\">\n{\"@context\":\"https:\/\/schema.org\",\"@type\":\"BlogPosting\",\"author\":{\"@type\":\"Organization\",\"name\":\"nTokenX\"},\"dateModified\":\"2026-10-02\",\"datePublished\":\"2026-10-02\",\"description\":\"Roo Code\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578bAPI\u6559\u7a0b\uff0c\u8bb2\u6e05 Base URL\u3001API Key\u3001\u6a21\u578b ID\u3001\u539f\u751f\u5de5\u5177\u8c03\u7528\u9a8c\u8bc1\u53ca 401\u3001404\u3001429 \u6392\u9519\uff0c\u5e76\u8bf4\u660e\u9879\u76ee\u505c\u66f4\u540e\u7684\u5b89\u5168\u8fb9\u754c\uff0c\u6309\u6b65\u9aa4\u5b8c\u6210\u5b58\u91cf\u914d\u7f6e\u4e0e\u8fc1\u79fb\u5224\u65ad\u3002\",\"headline\":\"Roo Code\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578bAPI\u6559\u7a0b\uff1a\u53c2\u6570\u3001\u9a8c\u8bc1\u4e0e\u505c\u66f4\u98ce\u9669\",\"image\":\"https:\/\/ntokenx.com\/blog\/wp-content\/uploads\/2026\/10\/art-8367-cover.jpg\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"nTokenX\"}}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Roo Code\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578bAPI\u6559\u7a0b\uff0c\u8bb2\u6e05 Base URL\u3001API Key\u3001\u6a21\u578b ID\u3001\u539f\u751f\u5de5\u5177\u8c03\u7528\u9a8c\u8bc1\u53ca 401\u3001404\u3001429 \u6392\u9519\uff0c\u5e76\u8bf4\u660e\u9879\u76ee\u505c\u66f4\u540e\u7684\u5b89\u5168\u8fb9\u754c\uff0c\u6309\u6b65\u9aa4\u5b8c\u6210\u5b58\u91cf\u914d\u7f6e\u4e0e\u8fc1\u79fb\u5224\u65ad\u3002<\/p>\n","protected":false},"author":1,"featured_media":237,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-238","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/238","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=238"}],"version-history":[{"count":1,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/238\/revisions"}],"predecessor-version":[{"id":286,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/238\/revisions\/286"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/237"}],"wp:attachment":[{"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=238"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=238"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=238"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}