{"id":66012,"date":"2026-01-26T02:40:57","date_gmt":"2026-01-25T18:40:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/66012.html"},"modified":"2026-01-26T02:40:57","modified_gmt":"2026-01-25T18:40:57","slug":"%e7%8e%a9%e8%bd%ac-intern-s1-%e5%a4%a7%e6%a8%a1%e5%9e%8b-api-%e5%85%a8%e6%b5%81%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/66012.html","title":{"rendered":"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b"},"content":{"rendered":"<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e00\u3001\u6838\u5fc3\u73af\u5883\u51c6\u5907<\/p>\n<ul>\n<li style=\"text-align:left\">\u5b89\u88c5\u4f9d\u8d56&#xff1a;\u901a\u8fc7 <span style=\"background-color:#eff0f1\">pip install openai<\/span>\u00a0\u5b89\u88c5\u5b98\u65b9 SDK&#xff0c;\u82e5\u73af\u5883\u5b58\u5728\u591a\u7248\u672c\u95ee\u9898&#xff0c;\u5efa\u8bae\u4f7f\u7528 <span style=\"background-color:#eff0f1\">pip3<\/span>\u3002<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u521d\u59cb\u5316\u5ba2\u6237\u7aef&#xff1a;<\/li>\n<\/ul>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:22.0500pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:391.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Python<\/span> from openai import OpenAI client &#061; OpenAI( \u00a0\u00a0\u00a0\u00a0api_key&#061;&#034;\u4f60\u7684API Key&#034;, \u00a0\u00a0\u00a0\u00a0base_url&#061;&#034;https:\/\/chat.intern-ai.org.cn\/api\/v1\/&#034; )<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u2705 \u6ce8\u610f&#xff1a;<span style=\"background-color:#eff0f1\">api_key<\/span>\u00a0\u5fc5\u987b\u7528\u5b57\u7b26\u4e32\u5305\u88f9&#xff0c;\u5426\u5219\u4f1a\u89e6\u53d1\u8bed\u6cd5\u9519\u8bef&#xff1b;\u5982\u679c\u4f7f\u7528 <span style=\"background-color:#eff0f1\">getpass<\/span>\u00a0\u52a8\u6001\u8f93\u5165&#xff0c;\u5c31\u4e0d\u8981\u518d\u5728\u4ee3\u7801\u91cc\u5199\u6b7b <span style=\"background-color:#eff0f1\">api_key<\/span>&#xff0c;\u907f\u514d\u51b2\u7a81\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e8c\u3001\u57fa\u7840\u6587\u672c\u4ea4\u4e92<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">1. \u666e\u901a\u5bf9\u8bdd<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Python<\/span> completion &#061; client.chat.completions.create( \u00a0\u00a0\u00a0\u00a0model&#061;&#034;intern-s1&#034;, \u00a0\u00a0\u00a0\u00a0messages&#061;[ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: &#034;\u5199\u4e00\u4e2a\u5173\u4e8e\u72ec\u89d2\u517d\u7684\u7761\u524d\u6545\u4e8b&#xff0c;\u4e00\u53e5\u8bdd\u5c31\u591f\u4e86\u3002&#034;} \u00a0\u00a0\u00a0\u00a0] ) print(completion.choices[0].message.content)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">2. \u5f00\u542f\u601d\u8003\u6a21\u5f0f&#xff08;<span style=\"background-color:#eff0f1\">thinking_mode<\/span>&#xff09;<\/p>\n<ul>\n<li style=\"text-align:left\">\u5f53 <span style=\"background-color:#eff0f1\">extra_body&#061;{&#034;thinking_mode&#034;: True}<\/span>\u00a0\u65f6&#xff0c;\u6a21\u578b\u4f1a\u8fd4\u56de\u601d\u8003\u8fc7\u7a0b&#043;\u6700\u7ec8\u56de\u7b54&#xff0c;\u9002\u5408\u9700\u8981\u63a8\u7406\u7684\u573a\u666f\u3002<\/li>\n<\/ul>\n<ul>\n<li style=\"text-align:left\">\u5f53 <span style=\"background-color:#eff0f1\">thinking_mode&#061;False<\/span>\u00a0\u65f6&#xff0c;\u4ec5\u8fd4\u56de\u6700\u7ec8\u7ed3\u679c&#xff0c;\u66f4\u9002\u5408\u8ffd\u6c42\u7b80\u6d01\u8f93\u51fa\u7684\u573a\u666f\u3002<\/li>\n<\/ul>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">3. \u6d41\u5f0f\u8f93\u51fa<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u901a\u8fc7\u8bbe\u7f6e <span style=\"background-color:#eff0f1\">stream&#061;True<\/span>\u00a0\u53ef\u4ee5\u5b9e\u73b0\u9010\u5b57\u8f93\u51fa&#xff0c;\u63d0\u5347\u4ea4\u4e92\u4f53\u9a8c&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Python<\/span> stream &#061; client.chat.completions.create( \u00a0\u00a0\u00a0\u00a0model&#061;&#034;intern-s1&#034;, \u00a0\u00a0\u00a0\u00a0messages&#061;[{&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: &#034;Say &#039;1 2 3 4 5 6 7&#039; ten times fast.&#034;}], \u00a0\u00a0\u00a0\u00a0stream&#061;True ) for chunk in stream: \u00a0\u00a0\u00a0\u00a0if chunk.choices[0].delta.content: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0print(chunk.choices[0].delta.content, end&#061;&#034;&#034;, flush&#061;True)<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e09\u3001\u591a\u6a21\u6001\u80fd\u529b\u5b9e\u8df5<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">1. \u7f51\u7edc\u56fe\u7247\u8f93\u5165<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Python<\/span> response &#061; client.chat.completions.create( \u00a0\u00a0\u00a0\u00a0model&#061;&#034;intern-s1&#034;, \u00a0\u00a0\u00a0\u00a0messages&#061;[ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;role&#034;: &#034;user&#034;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;content&#034;: [ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{&#034;type&#034;: &#034;text&#034;, &#034;text&#034;: &#034;\u56fe\u7247\u91cc\u6709\u4ec0\u4e48&#xff1f;&#034;}, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;type&#034;: &#034;image_url&#034;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;image_url&#034;: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;url&#034;: &#034;https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260125184056-697663b8b9f18.jpg&#034; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0], \u00a0\u00a0\u00a0\u00a0extra_body&#061;{&#034;thinking_mode&#034;: True} )<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">2. \u672c\u5730\u56fe\u7247\u8f93\u5165&#xff08;Base64\u7f16\u7801&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5148\u5c06\u672c\u5730\u56fe\u7247\u7f16\u7801\u4e3a Base64 \u5b57\u7b26\u4e32&#xff0c;\u518d\u4f20\u7ed9\u6a21\u578b&#xff0c;\u662f\u6700\u7a33\u5b9a\u7684\u672c\u5730\u56fe\u7247\u8c03\u7528\u65b9\u5f0f&#xff1a;<\/p>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:-0.6000pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:414.0000pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Python<\/span> import base64 def encode_image(image_path): \u00a0\u00a0\u00a0\u00a0with open(image_path, &#034;rb&#034;) as image_file: \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0return base64.b64encode(image_file.read()).decode(&#034;utf-8&#034;)  base64_image &#061; encode_image(&#034;Gfp-wisconsin-madison-the-nature-boardwalk.jpg&#034;) response &#061; client.chat.completions.create( \u00a0\u00a0\u00a0\u00a0model&#061;&#034;intern-s1&#034;, \u00a0\u00a0\u00a0\u00a0messages&#061;[ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;role&#034;: &#034;user&#034;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;content&#034;: [ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{&#034;type&#034;: &#034;text&#034;, &#034;text&#034;: &#034;\u56fe\u7247\u91cc\u6709\u4ec0\u4e48&#xff1f;&#034;}, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{ \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;type&#034;: &#034;image_url&#034;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;image_url&#034;: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;url&#034;: f&#034;data:image\/jpeg;base64,{base64_image}&#034; \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0] )<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u56db\u3001\u5de5\u5177\u8c03\u7528&#xff08;Function Call&#xff09;<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u5b9e\u73b0\u6a21\u578b\u4e0e\u5916\u90e8\u5de5\u5177\u7684\u8054\u52a8&#xff0c;\u4ee5\u5929\u6c14\u67e5\u8be2\u4e3a\u4f8b&#xff1a;<\/p>\n<li style=\"text-align:left\">\u5b9a\u4e49\u5de5\u5177<\/li>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:22.0500pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:391.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Python<\/span> tools &#061; [{ \u00a0\u00a0\u00a0\u00a0&#034;type&#034;: &#034;function&#034;, \u00a0\u00a0\u00a0\u00a0&#034;function&#034;: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;name&#034;: &#034;get_weather&#034;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;description&#034;: &#034;Get current temperature for a given location.&#034;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;parameters&#034;: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;type&#034;: &#034;object&#034;, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;properties&#034;: { \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;location&#034;: {&#034;type&#034;: &#034;string&#034;, &#034;description&#034;: &#034;City and country e.g. Paris, France&#034;} \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}, \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0&#034;required&#034;: [&#034;location&#034;] \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0} \u00a0\u00a0\u00a0\u00a0} }]<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<li style=\"text-align:left\">\u89e6\u53d1\u5de5\u5177\u8c03\u7528<\/li>\n<table border=\"1\" cellspacing=\"0\" style=\"margin-left:22.0500pt\">\n<tbody>\n<tr>\n<td style=\"background-color:#f5f6f7;width:391.3500pt\">\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\"><span style=\"color:#646a73\">Python<\/span> completion &#061; client.chat.completions.create( \u00a0\u00a0\u00a0\u00a0model&#061;&#034;intern-s1&#034;, \u00a0\u00a0\u00a0\u00a0messages&#061;[{&#034;role&#034;: &#034;user&#034;, &#034;content&#034;: &#034;What is the weather like in Paris today?&#034;}], \u00a0\u00a0\u00a0\u00a0tools&#061;tools ) # \u89e3\u6790\u5de5\u5177\u8c03\u7528\u6307\u4ee4 tool_calls &#061; completion.choices[0].message.tool_calls<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<li style=\"text-align:left\">\u5904\u7406\u5de5\u5177\u8fd4\u56de\u5e76\u751f\u6210\u6700\u7ec8\u56de\u7b54<\/li>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u8c03\u7528\u5916\u90e8\u63a5\u53e3\u83b7\u53d6\u5929\u6c14\u6570\u636e\u540e&#xff0c;\u5c06\u7ed3\u679c\u62fc\u63a5\u56de\u5bf9\u8bdd\u5386\u53f2&#xff0c;\u53d1\u8d77\u7b2c\u4e8c\u8f6e\u8bf7\u6c42&#xff0c;\u5373\u53ef\u5f97\u5230\u6574\u5408\u4e86\u5de5\u5177\u7ed3\u679c\u7684\u6700\u7ec8\u56de\u7b54\u3002<\/p>\n<p style=\"margin-left:.0001pt;margin-right:0;text-align:left\">\u4e94\u3001\u5e38\u89c1\u95ee\u9898\u4e0e\u907f\u5751\u6307\u5357<\/p>\n<li style=\"text-align:left\">\u8bed\u6cd5\u9519\u8bef&#xff1a;<span style=\"background-color:#eff0f1\">api_key<\/span>\u00a0\u672a\u52a0\u5f15\u53f7\u3001\u53c2\u6570\u95f4\u7f3a\u5c11\u9017\u53f7\u662f\u9ad8\u9891\u9519\u8bef&#xff0c;\u7f16\u5199\u4ee3\u7801\u65f6\u6ce8\u610f\u68c0\u67e5\u6807\u70b9\u7b26\u53f7\u3002<\/li>\n<li style=\"text-align:left\">\u591a\u6a21\u6001\u683c\u5f0f\u4e0d\u517c\u5bb9&#xff1a;<span style=\"background-color:#eff0f1\">intern-s1<\/span>\u00a0\u652f\u6301 <span style=\"background-color:#eff0f1\">image_url<\/span>\u00a0\u683c\u5f0f&#xff0c;\u4f46\u7f51\u7edc\u94fe\u63a5\u9700\u786e\u4fdd\u6a21\u578b\u53ef\u8bbf\u95ee&#xff1b;\u672c\u5730\u56fe\u7247\u5efa\u8bae\u4f7f\u7528 Base64 \u7f16\u7801\u3002<\/li>\n<li style=\"text-align:left\">\u8ba4\u8bc1\u5931\u8d25&#xff1a;\u786e\u4fdd <span style=\"background-color:#eff0f1\">api_key<\/span>\u00a0\u6b63\u786e\u4e14\u672a\u8fc7\u671f&#xff0c;\u82e5\u540c\u65f6\u4f7f\u7528 <span style=\"background-color:#eff0f1\">getpass<\/span>\u00a0\u548c\u786c\u7f16\u7801 <span style=\"background-color:#eff0f1\">api_key<\/span>&#xff0c;\u4f1a\u5bfc\u81f4\u8ba4\u8bc1\u51b2\u7a81\u3002<\/li>\n<li style=\"text-align:left\">\u8def\u5f84\u95ee\u9898&#xff1a;\u672c\u5730\u6587\u4ef6\u8bfb\u53d6\u65f6&#xff0c;\u4f18\u5148\u4f7f\u7528\u7edd\u5bf9\u8def\u5f84&#xff0c;\u6216\u786e\u4fdd\u56fe\u7247\u4e0e\u4ee3\u7801\u6587\u4ef6\u5728\u540c\u4e00\u76ee\u5f55\u4e0b&#xff0c;\u907f\u514d\u76f8\u5bf9\u8def\u5f84\u5f15\u53d1\u7684\u6587\u4ef6\u627e\u4e0d\u5230\u95ee\u9898\u3002<\/li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001\u6838\u5fc3\u73af\u5883\u51c6\u5907<br \/>\n\u5b89\u88c5\u4f9d\u8d56&#xff1a;\u901a\u8fc7 pip install openai\u00a0\u5b89\u88c5\u5b98\u65b9 SDK&#xff0c;\u82e5\u73af\u5883\u5b58\u5728\u591a\u7248\u672c\u95ee\u9898&#xff0c;\u5efa\u8bae\u4f7f\u7528 pip3\u3002<br \/>\n\u521d\u59cb\u5316\u5ba2\u6237\u7aef&#xff1a; Python from openai import OpenAI client  OpenAI( \u00a0\u00a0\u00a0\u00a0api_key\\&#8221;\u4f60\u7684API Key\\&#8221;, \u00a0\u00a0\u00a0\u00a0base_url\\&#8221;https:\/\/chat.intern-ai.org.cn\/api\/v1\/\\&#8221; )<br \/>\n\u2705 \u6ce8\u610f&amp;#<\/p>\n","protected":false},"author":2,"featured_media":66011,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[666,87,43],"topic":[],"class_list":["post-66012","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-microsoft","tag-87","tag-43"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/66012.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001\u6838\u5fc3\u73af\u5883\u51c6\u5907 \u5b89\u88c5\u4f9d\u8d56&#xff1a;\u901a\u8fc7 pip install openai\u00a0\u5b89\u88c5\u5b98\u65b9 SDK&#xff0c;\u82e5\u73af\u5883\u5b58\u5728\u591a\u7248\u672c\u95ee\u9898&#xff0c;\u5efa\u8bae\u4f7f\u7528 pip3\u3002 \u521d\u59cb\u5316\u5ba2\u6237\u7aef&#xff1a; Python from openai import OpenAI client OpenAI( \u00a0\u00a0\u00a0\u00a0api_key&quot;\u4f60\u7684API Key&quot;, \u00a0\u00a0\u00a0\u00a0base_url&quot;https:\/\/chat.intern-ai.org.cn\/api\/v1\/&quot; )  \u2705 \u6ce8\u610f&amp;#\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/66012.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-25T18:40:57+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66012.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/66012.html\",\"name\":\"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-25T18:40:57+00:00\",\"dateModified\":\"2026-01-25T18:40:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/66012.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/66012.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/66012.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/66012.html","og_locale":"zh_CN","og_type":"article","og_title":"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001\u6838\u5fc3\u73af\u5883\u51c6\u5907 \u5b89\u88c5\u4f9d\u8d56&#xff1a;\u901a\u8fc7 pip install openai\u00a0\u5b89\u88c5\u5b98\u65b9 SDK&#xff0c;\u82e5\u73af\u5883\u5b58\u5728\u591a\u7248\u672c\u95ee\u9898&#xff0c;\u5efa\u8bae\u4f7f\u7528 pip3\u3002 \u521d\u59cb\u5316\u5ba2\u6237\u7aef&#xff1a; Python from openai import OpenAI client OpenAI( \u00a0\u00a0\u00a0\u00a0api_key\"\u4f60\u7684API Key\", \u00a0\u00a0\u00a0\u00a0base_url\"https:\/\/chat.intern-ai.org.cn\/api\/v1\/\" )  \u2705 \u6ce8\u610f&amp;#","og_url":"https:\/\/www.wsisp.com\/helps\/66012.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-25T18:40:57+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/66012.html","url":"https:\/\/www.wsisp.com\/helps\/66012.html","name":"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-25T18:40:57+00:00","dateModified":"2026-01-25T18:40:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/66012.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/66012.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/66012.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u73a9\u8f6c intern-s1 \u5927\u6a21\u578b API \u5168\u6d41\u7a0b"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/66012","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=66012"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/66012\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/66011"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=66012"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=66012"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=66012"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=66012"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}