{"id":269,"date":"2026-10-07T02:14:38","date_gmt":"2026-10-07T02:14:38","guid":{"rendered":"https:\/\/ntokenx.com\/blog\/index.php\/2026\/10\/07\/anythingllm-custom-api\/"},"modified":"2026-10-07T02:14:38","modified_gmt":"2026-10-07T02:14:38","slug":"anythingllm-custom-api","status":"publish","type":"post","link":"https:\/\/ntokenx.com\/blog\/index.php\/2026\/10\/07\/anythingllm-custom-api\/","title":{"rendered":"AnythingLLM\u5bf9\u63a5\u81ea\u5b9a\u4e49\u5927\u6a21\u578bAPI\u6559\u7a0b\uff1a\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u6392\u9519"},"content":{"rendered":"<p><em>\u4f5c\u8005\uff1anTokenX\uff5c\u53d1\u5e03\u65e5\u671f\uff1a2026-10-07\uff5c\u66f4\u65b0\u65e5\u671f\uff1a2026-10-07<\/em><\/p>\n<p>AnythingLLM\u5bf9\u63a5\u81ea\u5b9a\u4e49\u5927\u6a21\u578bAPI\u6559\u7a0b\u7684\u5173\u952e\uff0c\u662f\u5728 AI Providers \u4e2d\u9009\u62e9 <strong>Generic OpenAI<\/strong>\uff0c\u7136\u540e\u51c6\u786e\u586b\u5199\u57fa\u7840\u5730\u5740\u3001\u5bc6\u94a5\u548c\u6a21\u578b ID\u3002\u4e0d\u8981\u628a\u804a\u5929\u63a5\u53e3\u5b8c\u6574\u8def\u5f84\u586b\u5165 Base URL\uff0c\u4e5f\u4e0d\u8981\u628a\u804a\u5929\u6a21\u578b\u4e0e\u5d4c\u5165\u6a21\u578b\u6df7\u4e3a\u4e00\u8c08\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-5470-1.jpg\" alt=\"AnythingLLM\u5bf9\u63a5\u81ea\u5b9a\u4e49\u5927\u6a21\u578bAPI\u6559\u7a0b\u914d\u7f6e\u754c\u9762\u793a\u610f\" style=\"max-width:100%;height:auto;\"><\/figure>\n<h2>AnythingLLM \u5982\u4f55\u63a5\u5165\u81ea\u5b9a\u4e49\u6a21\u578b\u63a5\u53e3\uff1f<\/h2>\n<p>AnythingLLM \u7684 Generic OpenAI \u662f\u9762\u5411\u5f00\u53d1\u8005\u7684\u901a\u7528\u8fde\u63a5\u5668\uff0c\u53ef\u63a5\u5165\u8bf7\u6c42\u683c\u5f0f\u4e0e\u54cd\u5e94\u7ed3\u6784\u517c\u5bb9 OpenAI API \u7684\u672c\u5730\u6a21\u578b\u3001\u7edf\u4e00\u7f51\u5173\u6216\u4e91\u7aef\u670d\u52a1\u3002<\/p>\n<p>\u5b98\u65b9\u5f53\u524d\u652f\u6301\u7684\u8bed\u8a00\u6a21\u578b\u5217\u8868\u5305\u542b OpenAI\u3001Claude\u3001Gemini\u3001DeepSeek\u3001OpenRouter\u3001LiteLLM\uff0c\u4ee5\u53ca OpenAI Generic \u7b49\u63d0\u4f9b\u5546\u3002\u672a\u88ab\u539f\u751f\u96c6\u6210\u4f46\u517c\u5bb9\u76f8\u5e94\u534f\u8bae\u7684\u670d\u52a1\uff0c\u901a\u5e38\u53ef\u4ee5\u4f7f\u7528 Generic OpenAI \u8fde\u63a5\u3002(<a href=\"https:\/\/docs.anythingllm.com\/features\/language-models\">docs.anythingllm.com<\/a>)<\/p>\n<p>\u63a5\u5165\u524d\u51c6\u5907\u56db\u9879\u4fe1\u606f\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;\">\u53c2\u6570<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u793a\u4f8b<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u6ce8\u610f\u4e8b\u9879<\/th>\n<\/tr>\n<\/thead>\n<tbody>\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;\"><code>https:\/\/api.example.com\/v1<\/code><\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u901a\u5e38\u4fdd\u7559 <code>\/v1<\/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;\"><code>sk-xxxx<\/code><\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5efa\u8bae\u4e3a AnythingLLM \u521b\u5efa\u4e13\u7528\u5bc6\u94a5<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Chat Model Name<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\"><code>provider\/model-id<\/code><\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5fc5\u987b\u4e0e\u5e73\u53f0\u63d0\u4f9b\u7684\u6a21\u578b ID \u5b8c\u5168\u4e00\u81f4<\/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;\"><code>32768<\/code><\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6309\u6a21\u578b\u771f\u5b9e\u9650\u5236\u586b\u5199\uff0c\u4e0d\u5b9c\u76f2\u76ee\u8c03\u5927<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u82e5\u4f7f\u7528 <a href=\"https:\/\/ntokenx.com\/\">nTokenX \u7edf\u4e00\u5927\u6a21\u578b API<\/a>\uff0c\u4e00\u4e2a API Key \u53ef\u8c03\u7528 GPT\u3001Claude\u3001Gemini\u3001Grok \u7b49\u591a\u4e2a\u6a21\u578b\uff1b\u5b9e\u9645\u914d\u7f6e\u65f6\u5e94\u4ee5\u63a7\u5236\u53f0\u63d0\u4f9b\u7684 Base URL \u548c\u6a21\u578b ID \u4e3a\u51c6\u3002<\/p>\n<h2>\u5982\u4f55\u5728\u684c\u9762\u7248\u4e2d\u5b8c\u6210\u914d\u7f6e\uff1f<\/h2>\n<p>\u684c\u9762\u7248\u9002\u5408\u4e2a\u4eba\u77e5\u8bc6\u5e93\u4e0e\u63a5\u5165\u9a8c\u8bc1\uff0c\u914d\u7f6e\u5168\u90e8\u901a\u8fc7\u56fe\u5f62\u754c\u9762\u5b8c\u6210\uff0c\u4e0d\u9700\u8981\u4fee\u6539\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<ol>\n<li>\u542f\u52a8 AnythingLLM\uff0c\u6253\u5f00 <strong>Settings<\/strong>\u3002<\/li>\n<li>\u8fdb\u5165 <strong>AI Providers \u2192 LLM<\/strong>\u3002<\/li>\n<li>\u5728 LLM Provider \u4e2d\u9009\u62e9 <strong>Generic OpenAI<\/strong>\uff0c\u4e0d\u8981\u9009\u62e9\u4ec5\u9762\u5411\u5b98\u65b9\u63a5\u53e3\u7684\u666e\u901a OpenAI\u3002<\/li>\n<li>\u586b\u5199 Base URL\u3001API Key\u3001Chat Model Name\u3002<\/li>\n<li>\u6309\u6a21\u578b\u6587\u6863\u586b\u5199 Token Context Window \u4e0e Max Tokens\u3002<\/li>\n<li>\u4fdd\u5b58\u540e\u65b0\u5efa\u5de5\u4f5c\u533a\uff0c\u53d1\u9001\u4e00\u6761\u4e0d\u542b\u6587\u6863\u7684\u77ed\u6d88\u606f\u3002<\/li>\n<li>\u82e5\u5de5\u4f5c\u533a\u66fe\u5355\u72ec\u8bbe\u7f6e\u6a21\u578b\uff0c\u8fdb\u5165 Workspace Settings \u68c0\u67e5\u5176\u914d\u7f6e\u662f\u5426\u8986\u76d6\u5168\u5c40\u8bbe\u7f6e\u3002<\/li>\n<\/ol>\n<p>Base URL \u5e94\u586b\u5199\u670d\u52a1\u6839\u8def\u5f84\uff0c\u4f8b\u5982\uff1a<\/p>\n<pre><code class=\"language-text\">https:\/\/api.example.com\/v1\n<\/code><\/pre>\n<p>\u4e0d\u8981\u586b\u5199\uff1a<\/p>\n<pre><code class=\"language-text\">https:\/\/api.example.com\/v1\/chat\/completions\n<\/code><\/pre>\n<p>AnythingLLM \u4f1a\u901a\u8fc7\u5ba2\u6237\u7aef\u7ee7\u7eed\u62fc\u63a5\u804a\u5929\u8def\u5f84\uff1b\u8bef\u586b\u5b8c\u6574\u7aef\u70b9\u5bb9\u6613\u4ea7\u751f\u8def\u5f84\u91cd\u590d\u548c 404 \u9519\u8bef\u3002\u5b98\u65b9\u6587\u6863\u540c\u65f6\u63d0\u9192\uff0cGeneric OpenAI \u7684\u53ef\u914d\u7f6e\u9879\u8f83\u591a\uff0c\u53ea\u6709\u786e\u8ba4\u76ee\u6807\u670d\u52a1\u517c\u5bb9 OpenAI \u8bf7\u6c42\u4e0e\u54cd\u5e94\u683c\u5f0f\u65f6\u624d\u5e94\u4f7f\u7528\u3002(<a href=\"https:\/\/github.com\/Mintplex-Labs\/anythingllm-docs\/blob\/main\/pages\/setup\/llm-configuration\/cloud\/openai-generic.mdx\">github.com<\/a>)<\/p>\n<h2>Docker \u90e8\u7f72\u5982\u4f55\u4f7f\u7528\u73af\u5883\u53d8\u91cf\uff1f<\/h2>\n<p>Docker \u90e8\u7f72\u9002\u5408\u56e2\u961f\u5171\u4eab\u3001\u670d\u52a1\u5668\u6258\u7ba1\u548c\u96c6\u4e2d\u8fd0\u7ef4\u3002\u6838\u5fc3\u53c2\u6570\u53ef\u4ee5\u5199\u5165\u6302\u8f7d\u5230 AnythingLLM \u5b58\u50a8\u76ee\u5f55\u7684 <code>.env<\/code> \u6587\u4ef6\u3002<\/p>\n<pre><code class=\"language-bash\">LLM_PROVIDER='generic-openai'\nGENERIC_OPEN_AI_BASE_PATH='https:\/\/api.example.com\/v1'\nGENERIC_OPEN_AI_MODEL_PREF='your-model-id'\nGENERIC_OPEN_AI_MODEL_TOKEN_LIMIT='32768'\nGENERIC_OPEN_AI_API_KEY='your-api-key'\n<\/code><\/pre>\n<p>\u82e5\u7f51\u5173\u8981\u6c42\u989d\u5916\u8bf7\u6c42\u5934\uff0c\u5f53\u524d\u5b98\u65b9\u793a\u4f8b\u8fd8\u63d0\u4f9b <code>GENERIC_OPEN_AI_CUSTOM_HEADERS<\/code>\uff1b\u90e8\u5206\u6a21\u578b\u4f7f\u7528 <code>max_completion_tokens<\/code> \u800c\u975e <code>max_tokens<\/code> \u65f6\uff0c\u53ef\u914d\u7f6e <code>GENERIC_OPEN_AI_MODEL_MAX_TOKEN_KEY<\/code>\u3002\u4fee\u6539 <code>.env<\/code> \u540e\u5e94\u91cd\u542f\u5bb9\u5668\u3002(<a href=\"https:\/\/github.com\/Mintplex-Labs\/anything-llm\/blob\/master\/server\/.env.example\">github.com<\/a>)<\/p>\n<pre><code class=\"language-bash\">docker restart anythingllm\n<\/code><\/pre>\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-5470-2.jpg\" alt=\"AnythingLLM\u81ea\u5b9a\u4e49\u5927\u6a21\u578bAPI\u7684Docker\u73af\u5883\u53d8\u91cf\u793a\u610f\" style=\"max-width:100%;height:auto;\"><\/figure>\n<h2>\u5982\u4f55\u9a8c\u8bc1\u63a5\u53e3\u662f\u5426\u771f\u6b63\u53ef\u7528\uff1f<\/h2>\n<p>\u201c\u754c\u9762\u80fd\u4fdd\u5b58\u201d\u4e0d\u7b49\u4e8e\u201c\u751f\u4ea7\u53ef\u7528\u201d\u3002\u5efa\u8bae\u6309\u7167\u7f51\u7edc\u3001\u534f\u8bae\u3001\u6a21\u578b\u3001\u77e5\u8bc6\u5e93\u56db\u5c42\u9010\u6b65\u9a8c\u6536\uff0c\u907f\u514d\u628a\u6240\u6709\u6545\u969c\u90fd\u5f52\u56e0\u4e8e API Key\u3002<\/p>\n<p>\u672c\u6587\u6838\u5bf9\u4e86 AnythingLLM \u5b98\u65b9\u6587\u6863\u4e0e\u5f53\u524d <code>.env<\/code> \u793a\u4f8b\u4e2d\u7684 <strong>7 \u4e2a\u5173\u952e\u914d\u7f6e\u9879<\/strong>\uff1a5 \u4e2a\u57fa\u7840\u9879\u548c2\u4e2a\u9ad8\u7ea7\u517c\u5bb9\u9879\uff0c\u7ed3\u679c\u4e3a <strong>7\/7 \u5747\u6709\u660e\u786e\u914d\u7f6e\u4f4d\u7f6e<\/strong>\u3002\u5728\u6b64\u57fa\u7840\u4e0a\uff0c\u53ef\u6267\u884c\u4ee5\u4e0b\u6700\u5c0f\u9a8c\u6536\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;\">\u5c42\u7ea7<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u6d4b\u8bd5\u65b9\u6cd5<\/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;\">\u7f51\u7edc\u5c42<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4ece\u90e8\u7f72\u673a\u5668\u8bbf\u95ee Base URL<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">DNS\u3001TLS\u3001\u4ee3\u7406\u8fde\u63a5\u6b63\u5e38<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u534f\u8bae\u5c42<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u53d1\u9001\u4e00\u6b21\u7b80\u5355\u804a\u5929\u8bf7\u6c42<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8fd4\u56de HTTP 200\uff0c\u54cd\u5e94\u542b\u6587\u672c\u5185\u5bb9<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6a21\u578b\u5c42<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6307\u5b9a\u51c6\u786e\u6a21\u578b ID<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e0d\u51fa\u73b0 model not found<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6d41\u5f0f\u5c42<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8fde\u7eed\u53d1\u90013\u6b21\u77ed\u95ee\u9898<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">3\/3 \u5b8c\u6574\u7ed3\u675f\uff0c\u65e0\u534a\u53e5\u4e2d\u65ad<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e0a\u4e0b\u6587\u5c42<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8f93\u5165\u8f83\u957f\u6587\u672c\u5e76\u8981\u6c42\u603b\u7ed3<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e0d\u51fa\u73b0\u957f\u5ea6\u8d85\u9650\u6216\u5f02\u5e38\u622a\u65ad<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">RAG\u5c42<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e0a\u4f201\u4efd\u6587\u6863\u5e76\u63d0\u95ee3\u4e2a\u4e8b\u5b9e<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u81f3\u5c11\u80fd\u7a33\u5b9a\u68c0\u7d22\u5230\u76f8\u5173\u7247\u6bb5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u8fd9\u4e2a\u516d\u9879\u77e9\u9635\u7684\u4ef7\u503c\u5728\u4e8e\u5b9a\u4f4d\u6545\u969c\u8fb9\u754c\uff1a\u666e\u901a\u804a\u5929\u5931\u8d25\uff0c\u4f18\u5148\u68c0\u67e5\u63a5\u53e3\uff1b\u804a\u5929\u6210\u529f\u4f46\u6587\u6863\u95ee\u7b54\u5931\u8d25\uff0c\u5e94\u8f6c\u5411\u5d4c\u5165\u6a21\u578b\u3001\u6587\u6863\u5207\u7247\u548c\u5411\u91cf\u5e93\u3002<\/p>\n<h2>\u4e3a\u4ec0\u4e48\u804a\u5929\u6b63\u5e38\uff0c\u77e5\u8bc6\u5e93\u5374\u6ca1\u6709\u7b54\u6848\uff1f<\/h2>\n<p>\u804a\u5929\u6a21\u578b\u8d1f\u8d23\u751f\u6210\u7b54\u6848\uff0c\u5d4c\u5165\u6a21\u578b\u8d1f\u8d23\u628a\u6587\u6863\u548c\u95ee\u9898\u8f6c\u6362\u4e3a\u5411\u91cf\uff0c\u4e24\u8005\u662f\u72ec\u7acb\u914d\u7f6e\u3002<strong>\u804a\u5929\u63a5\u53e3\u53ef\u7528\u5e76\u4e0d\u80fd\u8bc1\u660e Embedding \u63a5\u53e3\u53ef\u7528\u3002<\/strong><\/p>\n<p>\u5efa\u8bae\u91c7\u7528\u4ee5\u4e0b\u9a8c\u8bc1\u987a\u5e8f\uff1a<\/p>\n<ol>\n<li>\u5148\u5173\u95ed\u6587\u6863\u4e0a\u4e0b\u6587\uff0c\u9a8c\u8bc1\u7eaf\u804a\u5929\u3002<\/li>\n<li>\u5728 Embedder \u8bbe\u7f6e\u4e2d\u9009\u62e9\u5185\u7f6e\u6216\u5916\u90e8\u5d4c\u5165\u6a21\u578b\u3002<\/li>\n<li>\u4e0a\u4f20\u4e00\u4efd\u5305\u542b\u660e\u786e\u4eba\u540d\u3001\u65e5\u671f\u548c\u7f16\u53f7\u7684\u6d4b\u8bd5\u6587\u6863\u3002<\/li>\n<li>\u5b8c\u6210 Save and Embed \u540e\uff0c\u63d0\u51fa\u53ea\u80fd\u7531\u8be5\u6587\u6863\u56de\u7b54\u7684\u95ee\u9898\u3002<\/li>\n<li>\u82e5\u53ec\u56de\u4e0d\u51c6\uff0c\u518d\u8c03\u6574\u5207\u7247\u957f\u5ea6\u3001\u91cd\u53e0\u91cf\u548c\u68c0\u7d22\u6570\u91cf\u3002<\/li>\n<\/ol>\n<p>\u5df2\u7ecf\u5728 Dify \u4e2d\u7ba1\u7406\u6a21\u578b\u7684\u56e2\u961f\uff0c\u53ef\u53c2\u8003 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/19\/dify-api-config\/\">Dify \u914d\u7f6e\u7edf\u4e00\u591a\u6a21\u578b API<\/a> \u7edf\u4e00\u6a21\u578b\u547d\u540d\uff1b\u9700\u8981\u540c\u65f6\u670d\u52a1\u684c\u9762\u5ba2\u6237\u7aef\u65f6\uff0c\u4e5f\u53ef\u590d\u7528 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/27\/nextchat-custom-provider-api-tutorial\/\">NextChat \u81ea\u5b9a\u4e49\u670d\u52a1\u5546\u63a5\u53e3\u914d\u7f6e\u65b9\u6cd5<\/a>\u3002<\/p>\n<h2>\u5e38\u89c1\u9519\u8bef\u5982\u4f55\u5feb\u901f\u6392\u67e5\uff1f<\/h2>\n<p>\u9519\u8bef\u7801\u53ea\u662f\u6545\u969c\u5165\u53e3\uff0c\u6392\u67e5\u65f6\u5e94\u540c\u65f6\u67e5\u770b AnythingLLM \u65e5\u5fd7\u548c API \u670d\u52a1\u7aef\u8bf7\u6c42\u8bb0\u5f55\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;\">\u73b0\u8c61<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u5e38\u89c1\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\/403<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5bc6\u94a5\u65e0\u6548\u3001\u6743\u9650\u4e0d\u8db3<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u65b0\u5efa\u4e13\u7528 Key\uff0c\u68c0\u67e5\u6a21\u578b\u6743\u9650<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">404<\/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;\">\u5220\u9664 <code>\/chat\/completions<\/code>\uff0c\u68c0\u67e5\u662f\u5426\u91cd\u590d <code>\/v1<\/code><\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">429<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u914d\u989d\u3001\u5e76\u53d1\u6216\u901f\u7387\u53d7\u9650<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u964d\u4f4e\u5e76\u53d1\u5e76\u91c7\u7528\u6307\u6570\u9000\u907f<\/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 \u62fc\u5199\u9519\u8bef<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4ece\u670d\u52a1\u5546\u6a21\u578b\u5217\u8868\u590d\u5236\u5b8c\u6574 ID<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8fd4\u56de\u534a\u53e5\u540e\u4e2d\u65ad<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">SSE \u6d41\u5f0f\u683c\u5f0f\u4e0d\u517c\u5bb9<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u68c0\u67e5\u4ee3\u7406\u7f13\u51b2\u3001\u8d85\u65f6\u548c\u6d41\u5f0f\u54cd\u5e94<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e0a\u4e0b\u6587\u8d85\u9650<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">Context Window \u586b\u5199\u4e0d\u5b9e<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6309\u6a21\u578b\u9650\u5236\u964d\u4f4e\u4e0a\u4e0b\u6587\u548c\u8f93\u51fa\u957f\u5ea6<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u684c\u9762\u7248\u53ef\u7528\u3001Docker\u5931\u8d25<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5bb9\u5668\u7f51\u7edc\u4e0d\u53ef\u8fbe<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5728\u5bb9\u5668\u5185\u6d4b\u8bd5 DNS\u3001\u4ee3\u7406\u548c\u76ee\u6807\u7aef\u53e3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u9488\u5bf9\u9ad8\u5e76\u53d1\u573a\u666f\uff0c\u53ef\u8fdb\u4e00\u6b65\u91c7\u7528 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/10\/04\/llm-429-retry\/\">429 \u81ea\u52a8\u91cd\u8bd5\u4e0e\u6296\u52a8\u7b56\u7565<\/a>\uff1b\u4f01\u4e1a\u77e5\u8bc6\u5e93\u4e0d\u5e94\u53ea\u4f9d\u8d56\u5355\u4e00\u4e0a\u6e38\uff0c\u5efa\u8bae\u7ed3\u5408 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/10\/03\/llm-api-failover\/\">\u5927\u6a21\u578b API \u4e3b\u5907\u5207\u6362\u65b9\u6848<\/a> \u8bbe\u7f6e\u8d85\u65f6\u3001\u7194\u65ad\u548c\u964d\u7ea7\u8def\u7531\u3002<\/p>\n<h2>Agent \u5de5\u5177\u8c03\u7528\u9700\u8981\u989d\u5916\u6ce8\u610f\u4ec0\u4e48\uff1f<\/h2>\n<p>\u63a5\u53e3\u517c\u5bb9\u804a\u5929\u8865\u5168\uff0c\u4e0d\u4ee3\u8868\u4e00\u5b9a\u517c\u5bb9\u5de5\u5177\u8c03\u7528\u3002\u8ba1\u5212\u4f7f\u7528 Agent\u3001MCP \u6216\u81ea\u52a8\u5316\u6280\u80fd\u65f6\uff0c\u5e94\u786e\u8ba4\u6a21\u578b\u548c\u7f51\u5173\u80fd\u591f\u6b63\u786e\u5904\u7406 <code>tools<\/code>\u3001<code>tool_choice<\/code> \u4e0e <code>tool_calls<\/code>\u3002<\/p>\n<p>\u622a\u81f3 2026-10-07\uff0cAnythingLLM \u5f53\u524d\u914d\u7f6e\u6587\u6863\u8bf4\u660e\uff1a\u5bf9\u652f\u6301\u539f\u751f\u5de5\u5177\u8c03\u7528\u7684\u76f8\u5173\u63d0\u4f9b\u5546\uff0c\u8be5\u80fd\u529b\u9ed8\u8ba4\u542f\u7528\uff1b\u82e5\u67d0\u4e2a\u63a5\u53e3\u5b9e\u73b0\u4e0d\u5b8c\u6574\uff0c\u53ef\u901a\u8fc7 <code>PROVIDER_DISABLE_NATIVE_TOOL_CALLING<\/code> \u5c06 <code>generic-openai<\/code> \u5207\u56de\u63d0\u793a\u8bcd\u5f0f\u5de5\u5177\u8c03\u7528\u3002(<a href=\"https:\/\/github.com\/Mintplex-Labs\/anythingllm-docs\/blob\/main\/pages\/configuration.mdx\">github.com<\/a>)<\/p>\n<p>\u4e0a\u7ebf\u524d\u81f3\u5c11\u6d4b\u8bd5\u4e00\u6b21\u201c\u8c03\u7528\u5de5\u5177\u2014\u8bfb\u53d6\u7ed3\u679c\u2014\u7ee7\u7eed\u56de\u7b54\u201d\u7684\u5b8c\u6574\u94fe\u8def\uff0c\u800c\u4e0d\u662f\u53ea\u6d4b\u8bd5\u666e\u901a\u5bf9\u8bdd\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898<\/h2>\n<h3>AnythingLLM \u53ef\u4ee5\u63a5\u5165 Claude \u6216 Gemini \u5417\uff1f<\/h3>\n<p>\u53ef\u4ee5\u3002\u4f18\u5148\u4f7f\u7528 AnythingLLM \u5df2\u63d0\u4f9b\u7684\u539f\u751f\u63d0\u4f9b\u5546\uff1b\u82e5\u901a\u8fc7\u7edf\u4e00\u5927\u6a21\u578b API \u63a5\u5165\uff0c\u5219\u9700\u786e\u8ba4\u8be5\u63a5\u53e3\u4e0e Generic OpenAI \u6240\u9700\u7684\u8bf7\u6c42\u548c\u54cd\u5e94\u683c\u5f0f\u517c\u5bb9\u3002<\/p>\n<h3>Base URL \u672b\u5c3e\u5fc5\u987b\u5305\u542b <code>\/v1<\/code> \u5417\uff1f<\/h3>\n<p>\u53d6\u51b3\u4e8e\u670d\u52a1\u5546\u5b9a\u4e49\uff0c\u4f46\u591a\u6570 OpenAI \u517c\u5bb9\u670d\u52a1\u8981\u6c42\u4fdd\u7559 <code>\/v1<\/code>\u3002\u4e0d\u8981\u81ea\u884c\u8ffd\u52a0 <code>\/chat\/completions<\/code>\uff0c\u5e94\u4ee5\u5e73\u53f0\u63d0\u4f9b\u7684\u57fa\u7840\u5730\u5740\u4e3a\u51c6\u3002<\/p>\n<h3>\u4fee\u6539\u5168\u5c40\u6a21\u578b\u540e\u4e3a\u4ec0\u4e48\u5de5\u4f5c\u533a\u6ca1\u6709\u53d8\u5316\uff1f<\/h3>\n<p>\u5df2\u6709\u5de5\u4f5c\u533a\u53ef\u80fd\u4fdd\u5b58\u4e86\u5355\u72ec\u7684 LLM \u8bbe\u7f6e\uff0c\u4ece\u800c\u8986\u76d6\u5168\u5c40\u914d\u7f6e\u3002\u8fdb\u5165\u5bf9\u5e94\u5de5\u4f5c\u533a\u7684 Chat Settings \u68c0\u67e5\u5e76\u91cd\u65b0\u4fdd\u5b58\u3002<\/p>\n<h3>API Key \u5e94\u5982\u4f55\u7ba1\u7406\uff1f<\/h3>\n<p>\u4e3a\u6bcf\u4e2a AnythingLLM \u5b9e\u4f8b\u521b\u5efa\u72ec\u7acb\u5bc6\u94a5\uff0c\u9650\u5236\u53ef\u7528\u6a21\u578b\u548c\u989d\u5ea6\uff0c\u4e0d\u8981\u5c06\u5bc6\u94a5\u5199\u5165\u516c\u5f00\u4ed3\u5e93\u3001\u622a\u56fe\u6216\u524d\u7aef\u4ee3\u7801\u3002AnythingLLM \u5b98\u65b9\u4e5f\u660e\u786e\u63d0\u793a\uff0c\u6301\u6709\u5176\u5b9e\u4f8b API Key \u7684\u4eba\u5458\u53ef\u4ee5\u8c03\u7528\u76f8\u5e94\u63a5\u53e3\uff0c\u56e0\u6b64\u5bc6\u94a5\u4e0d\u5e94\u516c\u5f00\u3002(<a href=\"https:\/\/docs.anythingllm.com\/features\/api\">docs.anythingllm.com<\/a>)<\/p>\n<p><script type=\"application\/ld+json\">\n{\"@context\":\"https:\/\/schema.org\",\"@type\":\"Article\",\"author\":{\"@type\":\"Organization\",\"name\":\"nTokenX\"},\"dateModified\":\"2026-10-07\",\"datePublished\":\"2026-10-07\",\"description\":\"\u8be6\u89e3 AnythingLLM Generic OpenAI \u7684 Base URL\u3001API Key\u3001\u6a21\u578b\u540d\u79f0\u4e0e\u4e0a\u4e0b\u6587\u53c2\u6570\uff0c\u8986\u76d6\u684c\u9762\u7248\u3001Docker\u3001\u77e5\u8bc6\u5e93\u53ca Agent \u9a8c\u8bc1\uff0c\u5e76\u63d0\u4f9b\u56db\u5c42\u6392\u9519\u65b9\u6cd5\u3002\",\"headline\":\"AnythingLLM\u5bf9\u63a5\u81ea\u5b9a\u4e49\u5927\u6a21\u578bAPI\u6559\u7a0b\uff1a\u914d\u7f6e\u3001\u9a8c\u8bc1\u4e0e\u6392\u9519\",\"image\":\"https:\/\/ntokenx.com\/blog\/wp-content\/uploads\/2026\/10\/art-9068-cover.jpg\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"nTokenX\"}}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>AnythingLLM\u5bf9\u63a5\u81ea\u5b9a\u4e49\u5927\u6a21\u578bAPI\u6559\u7a0b\uff0c\u8be6\u89e3 Generic OpenAI \u7684 Base URL\u3001API Key\u3001\u6a21\u578b\u540d\u79f0\u4e0e\u4e0a\u4e0b\u6587\u53c2\u6570\uff0c\u8986\u76d6\u684c\u9762\u7248\u3001Docker\u3001\u77e5\u8bc6\u5e93\u53ca Agent \u9a8c\u8bc1\uff0c\u5e76\u7528\u56db\u5c42\u9a8c\u6536\u6cd5\u5b9a\u4f4d 401\u3001404\u3001429 \u548c\u6d41\u5f0f\u4e2d\u65ad\u95ee\u9898\u3002\u6309\u6b65\u9aa4\u5b8c\u6210\u914d\u7f6e\u5e76\u8fdb\u884c\u4e0a\u7ebf\u81ea\u68c0\u3002<\/p>\n","protected":false},"author":1,"featured_media":268,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-269","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\/269","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=269"}],"version-history":[{"count":0,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/268"}],"wp:attachment":[{"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}