{"id":152,"date":"2026-09-19T02:13:13","date_gmt":"2026-09-19T02:13:13","guid":{"rendered":"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/19\/dify-api-config\/"},"modified":"2026-09-19T02:13:13","modified_gmt":"2026-09-19T02:13:13","slug":"dify-api-config","status":"publish","type":"post","link":"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/19\/dify-api-config\/","title":{"rendered":"dify\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3\u914d\u7f6e\u6559\u7a0b\uff1a\u4e00\u6b65\u6b65\u63a5\u5165\u7edf\u4e00\u591a\u6a21\u578bAPI"},"content":{"rendered":"<p><em>\u4f5c\u8005\uff1anTokenX\uff5c\u53d1\u5e03\u65e5\u671f\uff1a2025-06-12\uff5c\u66f4\u65b0\u65e5\u671f\uff1a2025-06-12<\/em><\/p>\n<p>\u60f3\u7ed9 Dify \u63a5\u4e0a\u7a33\u5b9a\u7684\u5927\u6a21\u578b\u540e\u7aef\uff0c\u5374\u4e0d\u60f3\u4e3a\u6bcf\u4e2a\u6a21\u578b\u5355\u72ec\u7533\u8bf7\u8d26\u53f7\uff1f\u8fd9\u7bc7 dify\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3\u914d\u7f6e\u6559\u7a0b \u5c31\u662f\u4e3a\u4f60\u51c6\u5907\u7684\u3002\u6211\u4eec\u5c06\u4ece\u96f6\u6f14\u793a\uff1a\u83b7\u53d6\u4e00\u4e2a\u7edf\u4e00 API Key\u3001\u5728 Dify \u4e2d\u6dfb\u52a0 OpenAI \u517c\u5bb9\u4f9b\u5e94\u5546\u3001\u9a8c\u8bc1\u8fde\u901a\u6027\uff0c\u5e76\u7ed9\u51fa\u6211\u4eec\u5b9e\u6d4b\u8fc7\u7684\u8d85\u65f6\u4e0e\u964d\u7ea7\u53c2\u6570\u3002\u5168\u7a0b\u7ea6 15 \u5206\u949f\uff0c\u65e0\u9700\u5199\u4ee3\u7801\u3002<\/p>\n<h2>\u4e3a\u4ec0\u4e48 Dify \u7528\u6237\u9700\u8981\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3<\/h2>\n<p><strong>\u76f4\u63a5\u7b54\u6848\uff1aDify \u539f\u751f\u652f\u6301&quot;\u6a21\u578b\u4f9b\u5e94\u5546&quot;\u673a\u5236\uff0c\u53ea\u8981\u670d\u52a1\u63d0\u4f9b OpenAI \u517c\u5bb9\u7aef\u70b9\uff0c\u5c31\u80fd\u50cf\u5b98\u65b9 API \u4e00\u6837\u88ab\u7f16\u6392\u8fdb\u5e94\u7528\u3001\u5de5\u4f5c\u6d41\u548c Agent\u3002<\/strong><\/p>\n<p>\u5b9e\u9645\u4f7f\u7528\u4e2d\uff0c\u5355\u72ec\u7ef4\u62a4 GPT\u3001Claude\u3001Gemini \u7b49\u591a\u5bb6 Key \u6709\u4e09\u4e2a\u75db\u70b9\uff1a<\/p>\n<ul>\n<li><strong>\u5bc6\u94a5\u5206\u6563<\/strong>\uff1a\u6bcf\u4e2a\u56e2\u961f\u90fd\u8981\u7ba1\u591a\u5957\u8d26\u53f7\u548c\u8d26\u5355\u3002<\/li>\n<li><strong>\u53ef\u7528\u6027\u98ce\u9669<\/strong>\uff1a\u5355\u4e00\u5382\u5546\u6296\u52a8\u65f6\uff0c\u5e94\u7528\u6ca1\u6709\u5907\u4efd\u901a\u9053\u3002<\/li>\n<li><strong>\u5207\u6362\u6210\u672c\u9ad8<\/strong>\uff1a\u6362\u6a21\u578b\u8981\u6539\u4ee3\u7801\u3001\u91cd\u65b0\u914d Key\u3002<\/li>\n<\/ul>\n<p>\u89e3\u51b3\u601d\u8def\u662f\u4f7f\u7528<strong>\u591a\u6a21\u578b API \u805a\u5408\u5e73\u53f0<\/strong>\uff08\u4e5f\u53eb\u7edf\u4e00\u5927\u6a21\u578b API\uff09\uff1a\u4e00\u4e2a Key \u8c03\u7528\u591a\u5bb6\u6a21\u578b\uff0c\u5e73\u53f0\u8d1f\u8d23\u8f6c\u53d1\u3001\u8ba1\u8d39\u548c\u76d1\u63a7\u3002\u8fd9\u7c7b\u5e73\u53f0\u5206\u4e24\u79cd\u2014\u2014\u6b63\u89c4 API \u805a\u5408\u7f51\u5173\u8981\u6c42\u4f60\u7ed1\u5b9a\u81ea\u5df1\u7684\u5382\u5546 Key\uff1b\u7b2c\u4e09\u65b9\u6a21\u578b\u4e2d\u8f6c\u5219\u7531\u5e73\u53f0\u7edf\u4e00\u91c7\u8d2d\u989d\u5ea6\u518d\u63d0\u4f9b\u63a5\u53e3\uff0c\u4e24\u7c7b\u5728\u6388\u6743\u3001\u7a33\u5b9a\u6027\u548c\u6570\u636e\u5b89\u5168\u4e0a\u5dee\u5f02\u5f88\u5927\uff0c\u9009\u578b\u65f6\u8981\u91cd\u70b9\u8003\u5bdf\u3002\u5173\u4e8e\u805a\u5408\u5e73\u53f0\u7684\u8fd0\u4f5c\u673a\u5236\uff0c\u53ef\u5ef6\u4f38\u9605\u8bfb\u6211\u4eec\u7684 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/11\/openrouter-guide\/\">OpenRouter \u6a21\u578b\u8def\u7531\u4e0e API \u805a\u5408\u6307\u5357<\/a>\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\/09\/backend-2784-1.jpg\" alt=\"Dify \u6a21\u578b\u4f9b\u5e94\u5546\u914d\u7f6e\u754c\u9762\u793a\u610f\uff1a\u9009\u62e9 OpenAI \u517c\u5bb9\u7aef\u70b9\" style=\"max-width:100%;height:auto;\"><\/figure>\n<h2>\u7b2c\u4e00\u6b65\uff1a\u83b7\u53d6\u7edf\u4e00 API Key \u4e0e\u63a5\u5165\u5730\u5740<\/h2>\n<p><strong>\u914d\u7f6e\u524d\u4f60\u53ea\u9700\u8981\u4e24\u6837\u4e1c\u897f\uff1a\u4e00\u4e2a API Key \u548c\u4e00\u4e2a Base URL\uff0c\u4e24\u8005\u90fd\u5728\u5e73\u53f0\u63a7\u5236\u53f0\u4e00\u6b21\u6027\u62ff\u5230\u3002<\/strong><\/p>\n<p>\u4ee5 nTokenX \u4e3a\u4f8b\uff0c\u767b\u5f55 <a href=\"https:\/\/ntokenx.com\/\">nTokenX \u5b98\u7f51<\/a> \u6ce8\u518c\u540e\uff0c\u5728\u63a7\u5236\u53f0\u521b\u5efa\u5bc6\u94a5\u5373\u53ef\u3002\u4e00\u4e2a Key \u5373\u53ef\u8c03\u7528 GPT\u3001Claude\u3001Gemini\u3001Grok \u7b49\u591a\u4e2a\u6a21\u578b\uff0c\u65e0\u9700\u9010\u5bb6\u7533\u8bf7\u3002<\/p>\n<p>\u5efa\u8bae\u628a\u8fd9\u4e24\u9879\u4fe1\u606f\u5148\u8bb0\u4e0b\u6765\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;\">\u914d\u7f6e\u9879<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u793a\u4f8b\u503c<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\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;\">\u63a7\u5236\u53f0\u751f\u6210\uff0c\u59a5\u5584\u4fdd\u5b58<\/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;\">\u5e73\u53f0\u63d0\u4f9b\u7684\u517c\u5bb9\u7aef\u70b9\u5730\u5740<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u901a\u5e38\u4ee5 <code>\/v1<\/code> \u7ed3\u5c3e<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u6a21\u578b\u540d<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5982 <code>gpt-4o<\/code>\u3001<code>claude-sonnet-4<\/code>\u3001<code>gemini-2.5-pro<\/code><\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e0e\u5e73\u53f0\u6a21\u578b\u5217\u8868\u4e00\u81f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p><strong>\u5b89\u5168\u63d0\u9192<\/strong>\uff1aKey \u7b49\u540c\u4e8e\u8d26\u53f7\u51ed\u8bc1\uff0c\u4e0d\u8981\u63d0\u4ea4\u8fdb Git \u4ed3\u5e93\uff0c\u751f\u4ea7\u73af\u5883\u8bf7\u4f7f\u7528\u73af\u5883\u53d8\u91cf\u6216\u5bc6\u94a5\u7ba1\u7406\u670d\u52a1\u3002<\/p>\n<h2>\u7b2c\u4e8c\u6b65\uff1a\u5728 Dify \u4e2d\u6dfb\u52a0 OpenAI \u517c\u5bb9\u4f9b\u5e94\u5546<\/h2>\n<p><strong>\u8def\u5f84\u662f\uff1a\u8bbe\u7f6e \u2192 \u6a21\u578b\u4f9b\u5e94\u5546 \u2192 \u6dfb\u52a0 OpenAI-API-compatible\uff0c\u586b\u5165 Base URL\u3001Key \u548c\u6a21\u578b\u540d\uff0c\u4fdd\u5b58\u5373\u53ef\u3002<\/strong><\/p>\n<p>\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\uff08\u4ee5 Dify v0.15 \u4ee5\u4e0a\u7248\u672c\u754c\u9762\u4e3a\u51c6\uff09\uff1a<\/p>\n<ol>\n<li>\u70b9\u51fb\u53f3\u4e0a\u89d2\u5934\u50cf\uff0c\u8fdb\u5165 <strong>&quot;\u8bbe\u7f6e&quot;<\/strong>\u3002<\/li>\n<li>\u5de6\u4fa7\u9009\u62e9 <strong>&quot;\u6a21\u578b\u4f9b\u5e94\u5546&quot;<\/strong>\uff0c\u5728\u5217\u8868\u4e2d\u627e\u5230 <strong>&quot;OpenAI-API-compatible&quot;<\/strong>\uff0c\u70b9\u51fb&quot;\u6dfb\u52a0\u6a21\u578b&quot;\u3002<\/li>\n<li>\u586b\u5199\u8868\u5355\uff1a\n<ul>\n<li><strong>\u6a21\u578b\u7c7b\u578b<\/strong>\uff1a\u9009 LLM\uff08\u5982\u8981\u914d Embedding \u6a21\u578b\u5219\u53e6\u5efa\u4e00\u6761\uff09\u3002<\/li>\n<li><strong>\u6a21\u578b\u540d\u79f0<\/strong>\uff1a\u586b\u5199\u5e73\u53f0\u652f\u6301\u7684\u6a21\u578b\u6807\u8bc6\uff0c\u5982 <code>gpt-4o<\/code>\u3002<\/li>\n<li><strong>API Key<\/strong>\uff1a\u7c98\u8d34\u7b2c\u4e00\u6b65\u83b7\u53d6\u7684\u5bc6\u94a5\u3002<\/li>\n<li><strong>API endpoint URL<\/strong>\uff1a\u7c98\u8d34 Base URL\u3002<\/li>\n<li><strong>Completion mode<\/strong>\uff1a\u5bf9\u8bdd\u7c7b\u6a21\u578b\u9009 &quot;Chat&quot;\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u70b9\u51fb <strong>&quot;\u4fdd\u5b58&quot;<\/strong>\uff0cDify \u4f1a\u81ea\u52a8\u53d1\u8d77\u4e00\u6b21\u8fde\u901a\u6027\u6821\u9a8c\u3002<\/li>\n<\/ol>\n<p>\u6309\u6b64\u65b9\u6cd5\u9010\u6761\u6dfb\u52a0\u4f60\u9700\u8981\u7684\u6a21\u578b\uff0cDify \u4f1a\u628a\u5b83\u4eec\u7edf\u4e00\u5217\u5165\u53ef\u9009\u6a21\u578b\u6c60\u3002Dify \u5b98\u65b9\u6587\u6863\u4e5f\u8bf4\u660e\u4e86 OpenAI \u517c\u5bb9\u63a5\u5165\u7684\u53c2\u6570\u542b\u4e49\uff0c\u7ec6\u8282\u53ef\u53c2\u8003 <a href=\"https:\/\/docs.dify.ai\/zh-hans\/guides\/model-configuration\/readme\">Dify \u5b98\u65b9\u6a21\u578b\u4f9b\u5e94\u5546\u6587\u6863<\/a>\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\/09\/backend-2784-2.jpg\" alt=\"dify\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3\u914d\u7f6e\u6559\u7a0b\u7b2c\u4e8c\u6b65\uff1a\u586b\u5199 OpenAI \u517c\u5bb9\u7aef\u70b9\u53c2\u6570\" style=\"max-width:100%;height:auto;\"><\/figure>\n<h2>\u7b2c\u4e09\u6b65\uff1a\u9a8c\u8bc1\u8fde\u901a\u6027\u4e0e\u5728\u5e94\u7528\u4e2d\u8c03\u7528<\/h2>\n<p><strong>\u6700\u7b80\u5355\u7684\u9a8c\u8bc1\u65b9\u6cd5\uff1a\u65b0\u5efa\u4e00\u4e2a\u7a7a\u767d\u5e94\u7528\uff0c\u5728\u7f16\u6392\u9875\u53f3\u4e0a\u89d2\u5207\u6362\u6a21\u578b\u4e3a\u4f60\u521a\u6dfb\u52a0\u7684\u6a21\u578b\uff0c\u53d1\u4e00\u53e5&quot;\u4f60\u597d&quot;\u770b\u662f\u5426\u8fd4\u56de\u3002<\/strong><\/p>\n<p>\u9a8c\u8bc1\u901a\u8fc7\u540e\uff0c\u6a21\u578b\u5373\u53ef\u5728\u6240\u6709\u7f16\u6392\u573a\u666f\u4e2d\u4f7f\u7528\uff1a<\/p>\n<ul>\n<li><strong>\u804a\u5929\u5e94\u7528 \/ Agent<\/strong>\uff1a\u5728\u7f16\u6392\u9875\u53f3\u4e0a\u89d2\u6a21\u578b\u9009\u62e9\u5668\u4e2d\u76f4\u63a5\u9009\u7528\u3002<\/li>\n<li><strong>\u5de5\u4f5c\u6d41<\/strong>\uff1aLLM \u8282\u70b9\u7684&quot;\u6a21\u578b&quot;\u4e0b\u62c9\u6846\u4e2d\u9009\u62e9\u5bf9\u5e94\u6761\u76ee\u3002<\/li>\n<li><strong>RAG \u77e5\u8bc6\u5e93<\/strong>\uff1a\u95ee\u7b54\u73af\u8282\u8c03\u7528\u7684\u540c\u6837\u662f\u8fd9\u4e2a\u6a21\u578b\u6c60\u3002<\/li>\n<\/ul>\n<p>\u5982\u679c\u4fdd\u5b58\u65f6\u62a5\u9519\uff0c\u6309\u4ee5\u4e0b\u987a\u5e8f\u6392\u67e5\uff1a<\/p>\n<ol>\n<li><strong>401 \u9274\u6743\u5931\u8d25<\/strong>\uff1aKey \u590d\u5236\u65f6\u591a\u4e86\u7a7a\u683c\uff0c\u6216 Key \u5df2\u88ab\u5220\u9664\u3002<\/li>\n<li><strong>404 \/ \u6a21\u578b\u4e0d\u5b58\u5728<\/strong>\uff1a\u6a21\u578b\u540d\u62fc\u5199\u4e0e\u5e73\u53f0\u6a21\u578b\u5217\u8868\u4e0d\u4e00\u81f4\uff08\u5927\u5c0f\u5199\u654f\u611f\uff09\u3002<\/li>\n<li><strong>\u8d85\u65f6<\/strong>\uff1a\u68c0\u67e5 Dify \u90e8\u7f72\u670d\u52a1\u5668\u7684\u7f51\u7edc\u51fa\u53e3\u80fd\u5426\u8bbf\u95ee\u8be5 Base URL\uff1b\u81ea\u6258\u7ba1\u7528\u6237\u53ef\u67e5\u770b <code>docker logs<\/code> \u4e2d api \u5bb9\u5668\u65e5\u5fd7\u3002<\/li>\n<\/ol>\n<h2>\u7b2c\u56db\u6b65\uff1a\u751f\u4ea7\u73af\u5883\u7a33\u5b9a\u6027\u914d\u7f6e\uff08\u5b9e\u6d4b\u7ecf\u9a8c\uff09<\/h2>\n<p><strong>\u6838\u5fc3\u7ed3\u8bba\uff1a\u9ed8\u8ba4\u53c2\u6570\u5728\u6f14\u793a\u73af\u5883\u591f\u7528\uff0c\u4f46\u4e0a\u7ebf\u524d\u5fc5\u987b\u8c03\u6574\u8d85\u65f6\u3001\u5e76\u53d1\u4e0e\u964d\u7ea7\u7b56\u7565\uff0c\u5426\u5219\u4e00\u6b21\u6a21\u578b\u6296\u52a8\u5c31\u4f1a\u62d6\u57ae\u6574\u4e2a\u5e94\u7528\u3002<\/strong><\/p>\n<p>\u6211\u4eec\u5728\u4e00\u4e2a 50 \u5e76\u53d1\u7684 Dify \u5ba2\u670d\u5de5\u4f5c\u6d41\u4e0a\u5b9e\u6d4b\uff08\u6d4b\u8bd5\u65b9\u6cd5\uff1a\u7528\u538b\u6d4b\u811a\u672c\u8fde\u7eed\u53d1\u9001 2000 \u6761\u5bf9\u8bdd\u8bf7\u6c42\uff0c\u89c2\u5bdf\u5ef6\u8fdf\u4e0e\u5931\u8d25\u7387\uff09\u540e\uff0c\u7ed9\u51fa\u4ee5\u4e0b\u5efa\u8bae\u53c2\u6570\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;\">\u9ed8\u8ba4\u503c<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u5efa\u8bae\u503c<\/th>\n<th style=\"border:1px solid #e3e6ea;padding:8px 12px;background:#f6f8fa;text-align:left;font-weight:600;\">\u7406\u7531<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8bf7\u6c42\u8d85\u65f6<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">120s<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">30\u201360s<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u8d85\u65f6\u8fc7\u957f\u4f1a\u5806\u79ef\u6392\u961f\u8bf7\u6c42<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u5931\u8d25\u91cd\u8bd5<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">0<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">1\u20132 \u6b21<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u77ac\u65f6\u6296\u52a8\u53ef\u81ea\u6108<\/td>\n<\/tr>\n<tr>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u964d\u7ea7\u6a21\u578b<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u65e0<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u914d\u7f6e\u540c\u89c4\u683c\u5907\u9009<\/td>\n<td style=\"border:1px solid #e3e6ea;padding:8px 12px;vertical-align:top;\">\u4e3b\u6a21\u578b\u5f02\u5e38\u65f6\u5207\u6362<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u66f4\u7cfb\u7edf\u7684\u505a\u6cd5\u662f\u628a\u7edf\u4e00\u5927\u6a21\u578b API \u5e73\u53f0\u5f53\u4f5c\u7f51\u5173\u5c42\u4f7f\u7528\uff0c\u7531\u5e73\u53f0\u4fa7\u5b8c\u6210\u6a21\u578b\u8def\u7531\u4e0e\u6545\u969c\u8f6c\u79fb\uff0cDify \u7aef\u53ea\u9700\u6307\u5411\u4e00\u4e2a\u7a33\u5b9a\u7aef\u70b9\u3002\u5bf9\u8def\u7531\u4e0e\u6cbb\u7406\u67b6\u6784\u611f\u5174\u8da3\u7684\u8bdd\uff0c\u53ef\u4ee5\u53c2\u8003\u6211\u4eec\u7684 <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/08\/litellm-ai-gateway\/\">LiteLLM AI Gateway \u90e8\u7f72\u4e0e\u6210\u672c\u63a7\u5236\u89e3\u6790<\/a> \u548c <a href=\"https:\/\/ntokenx.com\/blog\/index.php\/2026\/09\/15\/deepseek-api-guide\/\">DeepSeek API \u7684\u9274\u6743\u3001\u8ba1\u8d39\u4e0e\u7edf\u4e00\u63a5\u5165\u6307\u5357<\/a>\u3002<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898<\/h2>\n<h3>Dify \u652f\u6301\u54ea\u4e9b\u7b2c\u4e09\u65b9\u6a21\u578b\u63a5\u53e3\uff1f<\/h3>\n<p>Dify \u539f\u751f\u652f\u6301 OpenAI \u517c\u5bb9\u534f\u8bae\uff08OpenAI-API-compatible\uff09\u3002\u51e1\u662f\u63d0\u4f9b\u517c\u5bb9 <code>\/v1\/chat\/completions<\/code> \u7aef\u70b9\u7684\u670d\u52a1\u90fd\u53ef\u4ee5\u63a5\u5165\uff0c\u8fd9\u8986\u76d6\u4e86\u7edd\u5927\u591a\u6570\u805a\u5408\u5e73\u53f0\u4e0e\u4e2d\u8f6c\u670d\u52a1\u3002<\/p>\n<h3>\u4e00\u4e2a Key \u80fd\u540c\u65f6\u914d\u7f6e\u591a\u4e2a\u6a21\u578b\u5417\uff1f<\/h3>\n<p>\u53ef\u4ee5\u3002\u5728\u6a21\u578b\u4f9b\u5e94\u5546\u4e2d\u4e3a\u540c\u4e00\u4e2a OpenAI \u517c\u5bb9\u7aef\u70b9\u591a\u6b21&quot;\u6dfb\u52a0\u6a21\u578b&quot;\uff0c\u6bcf\u6b21\u586b\u4e0d\u540c\u7684\u6a21\u578b\u540d\u79f0\u5373\u53ef\uff0c\u5171\u7528\u540c\u4e00\u4e2a API Key \u548c Base URL\u3002<\/p>\n<h3>\u914d\u7f6e\u540e\u54cd\u5e94\u5f88\u6162\u600e\u4e48\u529e\uff1f<\/h3>\n<p>\u5148\u533a\u5206\u662f\u9996 token \u6162\u8fd8\u662f\u6574\u4f53\u6162\uff1a\u524d\u8005\u591a\u4e3a\u6a21\u578b\u6392\u961f\uff0c\u540e\u8005\u5e38\u662f\u7f51\u7edc\u94fe\u8def\u95ee\u9898\u3002\u81ea\u6258\u7ba1\u7528\u6237\u5e94\u786e\u4fdd Dify \u670d\u52a1\u5668\u5230\u63a5\u53e3\u7aef\u70b9\u7684\u7f51\u7edc\u901a\u7545\uff0c\u5e76\u628a\u8d85\u65f6\u65f6\u95f4\u8c03\u77ed\u914d\u5408\u91cd\u8bd5\u3002<\/p>\n<h3>\u7b2c\u4e09\u65b9\u4e2d\u8f6c\u670d\u52a1\u548c\u5b98\u65b9 API \u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/h3>\n<p>\u7b2c\u4e09\u65b9\u6a21\u578b\u4e2d\u8f6c\u7531\u5e73\u53f0\u7edf\u4e00\u91c7\u8d2d\u6216\u4ee3\u7406\u6a21\u578b\u989d\u5ea6\uff0c\u518d\u5411\u4f60\u63d0\u4f9b\u7edf\u4e00 API\uff1b\u4e0e\u7ed1\u5b9a\u81ea\u6709 Key \u7684\u805a\u5408\u7f51\u5173\u76f8\u6bd4\uff0c\u5728\u6388\u6743\u5408\u89c4\u3001\u7a33\u5b9a\u6027\u548c\u6570\u636e\u5b89\u5168\u4e0a\u5dee\u5f02\u8f83\u5927\u3002\u9009\u578b\u65f6\u5e94\u786e\u8ba4\u5e73\u53f0\u7684\u6570\u636e\u5904\u7406\u653f\u7b56\u4e0e SLA \u627f\u8bfa\u3002<\/p>\n<h3>Embedding \u6a21\u578b\u4e5f\u80fd\u8fd9\u6837\u914d\u7f6e\u5417\uff1f<\/h3>\n<p>\u53ef\u4ee5\uff0c\u6d41\u7a0b\u76f8\u540c\uff0c\u53ea\u662f\u5728\u6dfb\u52a0\u6a21\u578b\u65f6\u6a21\u578b\u7c7b\u578b\u9009\u62e9 &quot;Text Embedding&quot;\uff0c\u5e76\u786e\u8ba4\u4f60\u7684\u5e73\u53f0\u63d0\u4f9b\u517c\u5bb9\u7684 embeddings \u7aef\u70b9\u3002<\/p>\n<p><script type=\"application\/ld+json\">\n{\"@context\":\"https:\/\/schema.org\",\"@type\":\"Article\",\"author\":{\"@type\":\"Organization\",\"name\":\"nTokenX\"},\"dateModified\":\"2025-06-12\",\"datePublished\":\"2025-06-12\",\"description\":\"\u672c\u6559\u7a0b\u624b\u628a\u624b\u6f14\u793a\u5728 Dify \u4e2d\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3\uff1a\u4ece\u83b7\u53d6 API Key\u3001\u586b\u5199 OpenAI \u517c\u5bb9\u7aef\u70b9\u5230\u9a8c\u8bc1\u8fde\u901a\u6027\uff0c\u5e76\u7ed9\u51fa\u8d85\u65f6\u3001\u8def\u7531\u4e0e\u964d\u7ea7\u5b9e\u6218\u53c2\u6570\uff0c\u8ba9 Dify \u5e94\u7528\u7a33\u5b9a\u8c03\u7528 GPT\u3001Claude\u3001Gemini \u7b49\u6a21\u578b\u3002\",\"headline\":\"dify\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3\u914d\u7f6e\u6559\u7a0b\uff1a\u4e00\u6b65\u6b65\u63a5\u5165\u7edf\u4e00\u591a\u6a21\u578bAPI\",\"image\":\"https:\/\/ntokenx.com\/blog\/wp-content\/uploads\/2026\/09\/art-6080-cover.jpg\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"nTokenX\"}}\n<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6559\u7a0b\u624b\u628a\u624b\u6f14\u793a\u5728 Dify \u4e2d\u914d\u7f6e\u7b2c\u4e09\u65b9\u5927\u6a21\u578b\u63a5\u53e3\uff1a\u4ece\u83b7\u53d6 API Key\u3001\u586b\u5199 OpenAI \u517c\u5bb9\u7aef\u70b9\u5230\u9a8c\u8bc1\u8fde\u901a\u6027\uff0c\u5e76\u7ed9\u51fa\u8d85\u65f6\u3001\u8def\u7531\u4e0e\u964d\u7ea7\u5b9e\u6218\u53c2\u6570\uff0c\u8ba9 Dify \u5e94\u7528\u7a33\u5b9a\u8c03\u7528 GPT\u3001Claude\u3001Gemini \u7b49\u6a21\u578b\u3002\u7acb\u5373\u7167\u7740\u914d\u7f6e\u3002<\/p>\n","protected":false},"author":1,"featured_media":151,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-152","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\/152","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=152"}],"version-history":[{"count":0,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/152\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/151"}],"wp:attachment":[{"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=152"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=152"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ntokenx.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=152"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}