{"id":227,"date":"2026-06-11T16:01:06","date_gmt":"2026-06-11T08:01:06","guid":{"rendered":"https:\/\/blog.mumudlin.com\/?p=227"},"modified":"2026-06-11T18:21:19","modified_gmt":"2026-06-11T10:21:19","slug":"%e4%ba%91%e9%9b%be-api-yunwu-ai-%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/blog.mumudlin.com\/index.php\/%e4%ba%91%e9%9b%be-api-yunwu-ai-%e4%bd%bf%e7%94%a8%e6%95%99%e7%a8%8b\/","title":{"rendered":"\u4e91\u96fe API (yunwu.ai) \u4f7f\u7528\u6559\u7a0b"},"content":{"rendered":"<h1>\u4e91\u96fe API (yunwu.ai) \u4f7f\u7528\u6559\u7a0b<\/h1>\n<blockquote>\n<p>\u9ad8\u901f\u3001\u7a33\u5b9a\u7684 AI API \u4e2d\u8f6c\u7ad9 \u2014 \u65e0\u9700\u4ee3\u7406\uff0c\u76f4\u8fde\u5168\u7403 AI \u6a21\u578b<\/p>\n<\/blockquote>\n<hr \/>\n<h2>\u76ee\u5f55<\/h2>\n<ol>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#1-\u4ec0\u4e48\u662f\u4e91\u96fe-api\">\u4ec0\u4e48\u662f\u4e91\u96fe API<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#2-\u652f\u6301\u6a21\u578b\u4e00\u89c8\">\u652f\u6301\u6a21\u578b\u4e00\u89c8<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#3-\u6ce8\u518c\u4e0e\u83b7\u53d6-api-key\">\u6ce8\u518c\u4e0e\u83b7\u53d6 API Key<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#4-\u8ba1\u8d39\u8bf4\u660e\">\u8ba1\u8d39\u8bf4\u660e<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#5-api-\u4f7f\u7528\u65b9\u6cd5\">API \u4f7f\u7528\u65b9\u6cd5<\/a>\n<ul>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#51-\u57fa\u7840\u4fe1\u606f\">5.1 \u57fa\u7840\u4fe1\u606f<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#52-python-openai-sdk\">5.2 Python (OpenAI SDK)<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#53-nodejs--typescript\">5.3 Node.js \/ TypeScript<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#54-curl-\u547d\u4ee4\u884c\">5.4 curl \u547d\u4ee4\u884c<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#55-\u5e38\u7528\u7b2c\u4e09\u65b9\u5ba2\u6237\u7aef\u914d\u7f6e\">5.5 \u5e38\u7528\u7b2c\u4e09\u65b9\u5ba2\u6237\u7aef\u914d\u7f6e<\/a><\/li>\n<\/ul>\n<\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#6-midjourney-\u7ed8\u56fe\">Midjourney \u7ed8\u56fe<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#7-\u89c6\u9891\u751f\u6210\">\u89c6\u9891\u751f\u6210<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#8-\u514d\u8d39\u4f7f\u7528\">\u514d\u8d39\u4f7f\u7528<\/a><\/li>\n<li><a target=\"_blank\" rel=\"noopener\" href=\"#9-\u5e38\u89c1\u95ee\u9898\">\u5e38\u89c1\u95ee\u9898<\/a><\/li>\n<\/ol>\n<hr \/>\n<h2>1. \u4ec0\u4e48\u662f\u4e91\u96fe API<\/h2>\n<p><strong>\u4e91\u96fe API\uff08yunwu.ai\uff09<\/strong> \u662f\u4e00\u4e2a OpenAI \u683c\u5f0f\u517c\u5bb9\u7684 API \u4e2d\u8f6c\u7ad9\uff0c\u4e3b\u8981\u9762\u5411\u56fd\u5185\u5f00\u53d1\u8005\u3002\u5b83\u5c06 OpenAI\u3001Anthropic Claude\u3001Google Gemini\u3001xAI Grok\u3001DeepSeek\u3001\u901a\u4e49\u5343\u95ee\u3001\u667a\u8c31 GLM\u3001Kimi\u3001MiniMax \u7b49 <strong>450+ \u6b3e\u6a21\u578b<\/strong>\u7edf\u4e00\u4e3a\u4e00\u4e2a\u63a5\u53e3\uff0c\u4f7f\u7528\u6807\u51c6\u7684 OpenAI API \u683c\u5f0f\u5373\u53ef\u8c03\u7528\u3002<\/p>\n<p>\u6838\u5fc3\u4f18\u52bf\uff1a<\/p>\n<ul>\n<li>\u2705 <strong>\u65e0\u9700\u4ee3\u7406<\/strong> \u2014 \u5168\u7403\u76f4\u8fde\uff0c\u56fd\u5185\u53ef\u76f4\u63a5\u8bbf\u95ee<\/li>\n<li>\u2705 <strong>\u65e0\u9700\u5916\u5e01\u5361<\/strong> \u2014 \u4eba\u6c11\u5e01\u5145\u503c\uff0c\u652f\u4ed8\u5b9d\/\u5fae\u4fe1\u5373\u53ef<\/li>\n<li>\u2705 <strong>1 \u5143\u8d77\u5145<\/strong> \u2014 \u6781\u4f4e\u95e8\u69db\u4f53\u9a8c<\/li>\n<li>\u2705 <strong>OpenAI SDK \u517c\u5bb9<\/strong> \u2014 \u6539\u4e00\u884c <code>base_url<\/code> \u5373\u53ef\u8fc1\u79fb<\/li>\n<li>\u2705 <strong>\u652f\u6301\u6d41\u5f0f\u8f93\u51fa (SSE)<\/strong> \u2014 \u6240\u6709\u804a\u5929\u6a21\u578b\u5747\u652f\u6301<\/li>\n<li>\u2705 <strong>99.9% \u53ef\u7528\u6027<\/strong> \u2014 \u53f7\u79f0\u9ad8\u7a33\u5b9a\u6027<\/li>\n<\/ul>\n<hr \/>\n<h2>2. \u652f\u6301\u6a21\u578b\u4e00\u89c8<\/h2>\n<p>\u622a\u81f3 2025 \u5e74\u4e2d\uff0c\u4e91\u96fe API \u5171\u6258\u7ba1 <strong>450+ \u6a21\u578b<\/strong>\u3002\u4ee5\u4e0b\u662f\u7cbe\u9009\u5217\u8868\uff1a<\/p>\n<h3>\u5bf9\u8bdd\/\u63a8\u7406\u6a21\u578b<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u5382\u5546<\/th>\n<th>\u6a21\u578b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>OpenAI<\/strong><\/td>\n<td><code>gpt-5.2<\/code>, <code>gpt-5.2-codex<\/code>, <code>gpt-5.1<\/code>, <code>gpt-5-pro<\/code>, <code>gpt-5<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Anthropic<\/strong><\/td>\n<td><code>claude-opus-4-5<\/code>, <code>claude-sonnet-4-5<\/code>, <code>claude-haiku-4-5<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Google<\/strong><\/td>\n<td><code>gemini-3-pro-preview<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>xAI<\/strong><\/td>\n<td><code>grok-4.1<\/code>, <code>grok-4<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>DeepSeek<\/strong><\/td>\n<td><code>deepseek-v3.2<\/code>, <code>deepseek-r1<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u963f\u91cc<\/strong><\/td>\n<td><code>qwen3-max<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u667a\u8c31<\/strong><\/td>\n<td><code>glm-4.6<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u6708\u4e4b\u6697\u9762<\/strong><\/td>\n<td><code>kimi-k2-thinking<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>MiniMax<\/strong><\/td>\n<td><code>minimax-m2<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u56fe\u50cf\u751f\u6210<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6a21\u578b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>gpt-image-2<\/code>, <code>gpt-image-1.5<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>flux-2-pro<\/code>, <code>flux.1-kontext-pro<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>qwen-image-2.0<\/code>, <code>grok-4.2-image<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>doubao-seedream-5-0-260128<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u89c6\u9891\u751f\u6210<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6a21\u578b<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>sora-2<\/code>, <code>veo3.1<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>kling-2.6<\/code>, <code>viduq3<\/code>, <code>viduq3-pro<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>seedance-1-5-pro<\/code>, <code>MiniMax-Hailuo-2.3<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Midjourney<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u64cd\u4f5c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>mj_imagine<\/code>\uff08\u6587\u751f\u56fe\uff09, <code>mj_variation<\/code>\uff08\u53d8\u4f53\uff09, <code>mj_upscale<\/code>\uff08\u653e\u5927\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>mj_reroll<\/code>\uff08\u91cd\u65b0\u751f\u6210\uff09, <code>mj_blend<\/code>\uff08\u6df7\u5408\uff09, <code>mj_describe<\/code>\uff08\u56fe\u751f\u6587\uff09<\/td>\n<\/tr>\n<tr>\n<td><code>mj_zoom<\/code>\uff08\u7f29\u653e\uff09, <code>mj_pan<\/code>\uff08\u5e73\u79fb\uff09, <code>mj_inpaint<\/code>\uff08\u5c40\u90e8\u91cd\u7ed8\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\ud83d\udca1 <strong>\u63d0\u793a<\/strong>\uff1a\u5b8c\u6574\u6a21\u578b\u5217\u8868\u53ef\u8c03\u7528 <code>GET \/v1\/models<\/code> \u63a5\u53e3\u5b9e\u65f6\u83b7\u53d6\u3002<\/p>\n<\/blockquote>\n<hr \/>\n<h2>3. \u6ce8\u518c\u4e0e\u83b7\u53d6 API Key<\/h2>\n<h3>\u4ed8\u8d39\u7528\u6237<\/h3>\n<ol>\n<li>\u6253\u5f00 <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/yunwu.ai\">yunwu.ai<\/a><\/li>\n<li>\u70b9\u51fb\u6ce8\u518c\uff0c\u4f7f\u7528\u90ae\u7bb1\u6216\u624b\u673a\u53f7\u521b\u5efa\u8d26\u6237<\/li>\n<li>\u8fdb\u5165\u63a7\u5236\u53f0\uff0c\u9009\u62e9\u5145\u503c\uff08<strong>\u6700\u4f4e 1 \u5143<\/strong>\uff09\uff0c\u652f\u6301\u652f\u4ed8\u5b9d\/\u5fae\u4fe1<\/li>\n<li>\u5145\u503c\u540e\u7cfb\u7edf\u81ea\u52a8\u751f\u6210 API Key\uff0c\u5728&quot;API Keys&quot;\u9875\u9762\u590d\u5236\u5373\u53ef<\/li>\n<\/ol>\n<h3>\u514d\u8d39\u7528\u6237<\/h3>\n<p>\u8bbf\u95ee <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/free.yunwu.ai\">free.yunwu.ai<\/a>\uff0c\u4f7f\u7528 GitHub \u8d26\u53f7\u767b\u5f55\u5373\u53ef\u83b7\u5f97\u514d\u8d39 API Key\uff0c\u6bcf\u65e5\u914d\u989d\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u6a21\u578b<\/th>\n<th>\u6bcf\u65e5\u9650\u989d<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>gpt-4o<\/code><\/td>\n<td>30 \u6b21<\/td>\n<\/tr>\n<tr>\n<td><code>gpt-4o-mini<\/code><\/td>\n<td>200 \u6b21<\/td>\n<\/tr>\n<tr>\n<td>DeepSeek \u7cfb\u5217<\/td>\n<td>30 \u6b21<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>4. \u8ba1\u8d39\u8bf4\u660e<\/h2>\n<table>\n<thead>\n<tr>\n<th>\u9879\u76ee<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u8ba1\u4ef7\u65b9\u5f0f<\/strong><\/td>\n<td>0.5 \u5143 \u2248 1 USD \u7684 token \u7528\u91cf\uff08\u7ea6\u5b98\u7f51\u4ef7\u683c\u7684 50%\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u6700\u4f4e\u5145\u503c<\/strong><\/td>\n<td>1 \u5143<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5e76\u53d1\u9650\u5236<\/strong><\/td>\n<td>\u5b98\u65b9\u5ba3\u79f0\u65e0\u9650\u5236<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8ba1\u8d39\u5355\u4f4d<\/strong><\/td>\n<td>\u6309\u6a21\u578b\u5b9e\u9645 token \u6d88\u8017\u6263\u8d39\uff0c\u4e0e OpenAI \u8ba1\u8d39\u65b9\u5f0f\u4e00\u81f4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>5. API \u4f7f\u7528\u65b9\u6cd5<\/h2>\n<h3>5.1 \u57fa\u7840\u4fe1\u606f<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u914d\u7f6e\u9879<\/th>\n<th>\u503c<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>Base URL<\/strong><\/td>\n<td><code>https:\/\/yunwu.ai\/v1<\/code>\uff08\u4e5f\u652f\u6301 <code>https:\/\/api.yunwu.ai\/v1<\/code>\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u8ba4\u8bc1\u65b9\u5f0f<\/strong><\/td>\n<td><code>Authorization: Bearer &lt;\u4f60\u7684API_Key&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Chat \u7aef\u70b9<\/strong><\/td>\n<td><code>POST \/v1\/chat\/completions<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>Embeddings<\/strong><\/td>\n<td><code>POST \/v1\/embeddings<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u56fe\u50cf\u751f\u6210<\/strong><\/td>\n<td><code>POST \/v1\/images\/generations<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u8bed\u97f3\u8f6c\u6587\u5b57<\/strong><\/td>\n<td><code>POST \/v1\/audio\/transcriptions<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u6587\u5b57\u8f6c\u8bed\u97f3<\/strong><\/td>\n<td><code>POST \/v1\/audio\/speech<\/code><\/td>\n<\/tr>\n<tr>\n<td><strong>\u6a21\u578b\u5217\u8868<\/strong><\/td>\n<td><code>GET \/v1\/models<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h3>5.2 Python (OpenAI SDK)<\/h3>\n<p>\u63a8\u8350\u65b9\u5f0f\uff0c\u4e0e\u5b98\u65b9 OpenAI \u7528\u6cd5\u51e0\u4e4e\u4e00\u81f4\uff1a<\/p>\n<pre><code class=\"language-python\">from openai import OpenAI\n\n# \u521d\u59cb\u5316\u5ba2\u6237\u7aef\uff0c\u53ea\u9700\u4fee\u6539 base_url \u548c api_key\nclient = OpenAI(\n    base_url=&quot;https:\/\/yunwu.ai\/v1&quot;,\n    api_key=&quot;your-yunwu-api-key&quot;  # \u66ff\u6362\u4e3a\u4f60\u7684 API Key\n)\n\n# \u804a\u5929\u8865\u5168\uff08\u975e\u6d41\u5f0f\uff09\nresponse = client.chat.completions.create(\n    model=&quot;gpt-5.2&quot;,\n    messages=[\n        {&quot;role&quot;: &quot;system&quot;, &quot;content&quot;: &quot;\u4f60\u662f\u4e00\u4e2a\u6709\u5e2e\u52a9\u7684\u52a9\u624b\u3002&quot;},\n        {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;\u8bf7\u7528\u4e00\u53e5\u8bdd\u4ecb\u7ecd\u4eba\u5de5\u667a\u80fd\u3002&quot;}\n    ]\n)\nprint(response.choices[0].message.content)\n\n# \u804a\u5929\u8865\u5168\uff08\u6d41\u5f0f SSE\uff09\nstream = client.chat.completions.create(\n    model=&quot;claude-sonnet-4-5&quot;,\n    messages=[\n        {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;\u5199\u4e00\u9996\u5173\u4e8e\u6625\u5929\u7684\u8bd7&quot;}\n    ],\n    stream=True\n)\nfor chunk in stream:\n    if chunk.choices[0].delta.content is not None:\n        print(chunk.choices[0].delta.content, end=&quot;&quot;)\n\n# \u83b7\u53d6\u6a21\u578b\u5217\u8868\nmodels = client.models.list()\nfor model in models.data:\n    print(model.id)<\/code><\/pre>\n<h4>\u5207\u6362\u6a21\u578b\u793a\u4f8b<\/h4>\n<pre><code class=\"language-python\"># OpenAI\nclient.chat.completions.create(model=&quot;gpt-5.2&quot;, messages=[...])\n\n# Claude\nclient.chat.completions.create(model=&quot;claude-sonnet-4-5&quot;, messages=[...])\n\n# DeepSeek\nclient.chat.completions.create(model=&quot;deepseek-r1&quot;, messages=[...])\n\n# Grok\nclient.chat.completions.create(model=&quot;grok-4.1&quot;, messages=[...])\n\n# \u901a\u4e49\u5343\u95ee\nclient.chat.completions.create(model=&quot;qwen3-max&quot;, messages=[...])\n\n# Gemini\nclient.chat.completions.create(model=&quot;gemini-3-pro-preview&quot;, messages=[...])<\/code><\/pre>\n<hr \/>\n<h3>5.3 Node.js \/ TypeScript<\/h3>\n<h4>\u4f7f\u7528 OpenAI SDK<\/h4>\n<pre><code class=\"language-bash\">npm install openai<\/code><\/pre>\n<pre><code class=\"language-ts\">import OpenAI from &quot;openai&quot;;\n\nconst client = new OpenAI({\n  baseURL: &quot;https:\/\/yunwu.ai\/v1&quot;,\n  apiKey: &quot;your-yunwu-api-key&quot;,\n});\n\nasync function main() {\n  const completion = await client.chat.completions.create({\n    model: &quot;gpt-5.2&quot;,\n    messages: [\n      { role: &quot;user&quot;, content: &quot;\u4f60\u597d\uff0c\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u4f60\u81ea\u5df1&quot; },\n    ],\n  });\n  console.log(completion.choices[0].message.content);\n}\n\nmain();<\/code><\/pre>\n<h4>\u6d41\u5f0f\u8f93\u51fa<\/h4>\n<pre><code class=\"language-ts\">const stream = await client.chat.completions.create({\n  model: &quot;claude-sonnet-4-5&quot;,\n  messages: [{ role: &quot;user&quot;, content: &quot;\u8bb2\u4e00\u4e2a\u7b11\u8bdd&quot; }],\n  stream: true,\n});\n\nfor await (const chunk of stream) {\n  process.stdout.write(chunk.choices[0]?.delta?.content || &quot;&quot;);\n}<\/code><\/pre>\n<hr \/>\n<h3>5.4 curl \u547d\u4ee4\u884c<\/h3>\n<pre><code class=\"language-bash\"># \u975e\u6d41\u5f0f\u8bf7\u6c42\ncurl https:\/\/yunwu.ai\/v1\/chat\/completions \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot; \\\n  -d &#039;{\n    &quot;model&quot;: &quot;gpt-5.2&quot;,\n    &quot;messages&quot;: [\n      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;\u7528\u4e00\u53e5\u8bdd\u89e3\u91ca\u4ec0\u4e48\u662f\u91cf\u5b50\u8ba1\u7b97&quot;}\n    ]\n  }&#039;\n\n# \u6d41\u5f0f\u8bf7\u6c42\ncurl https:\/\/yunwu.ai\/v1\/chat\/completions \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot; \\\n  -d &#039;{\n    &quot;model&quot;: &quot;gpt-5.2&quot;,\n    &quot;messages&quot;: [\n      {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &quot;\u7528\u4e00\u53e5\u8bdd\u89e3\u91ca\u4ec0\u4e48\u662f\u91cf\u5b50\u8ba1\u7b97&quot;}\n    ],\n    &quot;stream&quot;: true\n  }&#039;\n\n# \u67e5\u8be2\u53ef\u7528\u6a21\u578b\u5217\u8868\ncurl https:\/\/yunwu.ai\/v1\/models \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot;<\/code><\/pre>\n<hr \/>\n<h3>5.5 \u5e38\u7528\u7b2c\u4e09\u65b9\u5ba2\u6237\u7aef\u914d\u7f6e<\/h3>\n<p>\u4e91\u96fe API \u517c\u5bb9\u6240\u6709\u652f\u6301\u81ea\u5b9a\u4e49 OpenAI Base URL \u7684\u5ba2\u6237\u7aef\uff0c\u5728\u5bf9\u5e94\u8bbe\u7f6e\u4e2d\u586b\u5165\u4ee5\u4e0b\u4fe1\u606f\u5373\u53ef\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>\u914d\u7f6e\u9879<\/th>\n<th>\u586b\u5199\u5185\u5bb9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>API Provider \/ \u7c7b\u578b<\/td>\n<td>OpenAI \u6216 OpenAI Compatible<\/td>\n<\/tr>\n<tr>\n<td>Base URL \/ API \u5730\u5740<\/td>\n<td><code>https:\/\/yunwu.ai\/v1<\/code><\/td>\n<\/tr>\n<tr>\n<td>API Key<\/td>\n<td>\u4f60\u7684\u4e91\u96fe API Key<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u652f\u6301\u7684\u5ba2\u6237\u7aef\u5305\u62ec\u4f46\u4e0d\u9650\u4e8e\uff1a<\/p>\n<ul>\n<li><strong>ChatBox<\/strong>\uff08\u684c\u9762\u7aef AI \u804a\u5929\uff09<\/li>\n<li><strong>LobeChat<\/strong>\uff08\u81ea\u90e8\u7f72 AI \u804a\u5929\uff09<\/li>\n<li><strong>ChatGPT Next Web<\/strong>\uff08\u7f51\u9875\u7aef\u804a\u5929\uff09<\/li>\n<li><strong>Cursor<\/strong>\uff08AI \u7f16\u7a0b IDE\uff09\u2014 \u5728 Settings \u2192 Models \u4e2d\u6dfb\u52a0<\/li>\n<li><strong>Cline<\/strong>\uff08VS Code \u63d2\u4ef6\uff09\u2014 \u9009\u62e9 OpenAI Compatible<\/li>\n<li><strong>Aider<\/strong>\uff08\u7ec8\u7aef AI \u7f16\u7a0b\uff09\u2014 \u8bbe\u7f6e <code>OPENAI_API_BASE<\/code><\/li>\n<li><strong>Dify<\/strong>\uff08AI \u5e94\u7528\u5e73\u53f0\uff09<\/li>\n<li><strong>LangChain<\/strong> \/ <strong>llama_index<\/strong>\uff08\u5f00\u53d1\u6846\u67b6\uff09<\/li>\n<li><strong>Immersive Translate<\/strong>\uff08\u6c89\u6d78\u5f0f\u7ffb\u8bd1\u63d2\u4ef6\uff09<\/li>\n<li><strong>Zotero GPT<\/strong>\uff08\u6587\u732e\u7ba1\u7406\u63d2\u4ef6\uff09<\/li>\n<li><strong>AutoGPT<\/strong><\/li>\n<\/ul>\n<blockquote>\n<p>\ud83d\udcd6 \u8be6\u7ec6\u914d\u7f6e\u6559\u7a0b\u8bf7\u53c2\u8003\u5b98\u65b9\u6587\u6863\u7ad9: <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/yunwu.apifox.cn\">yunwu.apifox.cn<\/a><\/p>\n<\/blockquote>\n<hr \/>\n<h2>6. Midjourney \u7ed8\u56fe<\/h2>\n<p>Midjourney \u63a5\u53e3\u4f7f\u7528\u5355\u72ec\u7684\u7aef\u70b9\u8def\u5f84\uff08<strong>\u4e0d\u5728 <code>\/v1<\/code> \u4e0b<\/strong>\uff09\uff0c\u9700\u901a\u8fc7 HTTP POST \u63d0\u4ea4\u4efb\u52a1\u5e76\u8f6e\u8be2\u7ed3\u679c\u3002<\/p>\n<h3>\u53d1\u8d77\u7ed8\u56fe (imagine)<\/h3>\n<pre><code class=\"language-bash\">curl -X POST https:\/\/yunwu.ai\/mj\/submit\/imagine \\\n  -H &quot;Content-Type: application\/json&quot; \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot; \\\n  -d &#039;{\n    &quot;prompt&quot;: &quot;a beautiful sunset over the ocean, oil painting style --ar 16:9&quot;\n  }&#039;<\/code><\/pre>\n<p>\u8fd4\u56de\u793a\u4f8b\uff1a<\/p>\n<pre><code class=\"language-json\">{\n  &quot;id&quot;: &quot;task_id_xxx&quot;,\n  &quot;status&quot;: &quot;pending&quot;\n}<\/code><\/pre>\n<h3>\u67e5\u8be2\u4efb\u52a1\u7ed3\u679c<\/h3>\n<pre><code class=\"language-bash\">curl https:\/\/yunwu.ai\/mj\/task\/task_id_xxx\/fetch \\\n  -H &quot;Authorization: Bearer YOUR_API_KEY&quot;<\/code><\/pre>\n<h3>\u5176\u4ed6 Midjourney \u64cd\u4f5c<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u64cd\u4f5c<\/th>\n<th>\u7aef\u70b9<\/th>\n<th>\u8bf4\u660e<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\u53d8\u4f53<\/td>\n<td><code>POST \/mj\/submit\/variation<\/code><\/td>\n<td>\u57fa\u4e8e\u67d0\u5f20\u56fe\u751f\u6210\u53d8\u4f53<\/td>\n<\/tr>\n<tr>\n<td>\u653e\u5927<\/td>\n<td><code>POST \/mj\/submit\/upscale<\/code><\/td>\n<td>\u653e\u5927\u6307\u5b9a\u56fe\u50cf\u7684\u67d0\u4e00\u683c<\/td>\n<\/tr>\n<tr>\n<td>\u6df7\u5408<\/td>\n<td><code>POST \/mj\/submit\/blend<\/code><\/td>\n<td>\u591a\u56fe\u6df7\u5408<\/td>\n<\/tr>\n<tr>\n<td>\u56fe\u751f\u6587<\/td>\n<td><code>POST \/mj\/submit\/describe<\/code><\/td>\n<td>\u6839\u636e\u56fe\u7247\u751f\u6210 prompt<\/td>\n<\/tr>\n<tr>\n<td>\u7f29\u653e<\/td>\n<td><code>POST \/mj\/submit\/zoom<\/code><\/td>\n<td>\u7f29\u653e\u56fe\u50cf<\/td>\n<\/tr>\n<tr>\n<td>\u5e73\u79fb<\/td>\n<td><code>POST \/mj\/submit\/pan<\/code><\/td>\n<td>\u5e73\u79fb\u6269\u5c55\u56fe\u50cf<\/td>\n<\/tr>\n<tr>\n<td>\u5c40\u90e8\u91cd\u7ed8<\/td>\n<td><code>POST \/mj\/submit\/inpaint<\/code><\/td>\n<td>\u5c40\u90e8\u4fee\u6539<\/td>\n<\/tr>\n<tr>\n<td>\u91cd\u65b0\u751f\u6210<\/td>\n<td><code>POST \/mj\/submit\/reroll<\/code><\/td>\n<td>\u91cd\u65b0\u968f\u673a\u751f\u6210<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>7. \u89c6\u9891\u751f\u6210<\/h2>\n<p>\u89c6\u9891\u751f\u6210\u662f\u5f02\u6b65\u4efb\u52a1\uff0c\u63d0\u4ea4\u540e\u9700\u8f6e\u8be2\u7ed3\u679c\uff1a<\/p>\n<pre><code class=\"language-python\">from openai import OpenAI\n\nclient = OpenAI(\n    base_url=&quot;https:\/\/yunwu.ai\/v1&quot;,\n    api_key=&quot;your-yunwu-api-key&quot;\n)\n\n# \u63d0\u4ea4\u89c6\u9891\u751f\u6210\u4efb\u52a1\nresponse = client.post(&quot;\/v1\/video\/submit&quot;, json={\n    &quot;model&quot;: &quot;sora-2&quot;,\n    &quot;prompt&quot;: &quot;\u4e00\u53ea\u732b\u5728\u592a\u7a7a\u7ad9\u91cc\u5931\u91cd\u6f02\u6d6e&quot;,\n    &quot;size&quot;: &quot;1920x1080&quot;,\n    &quot;duration&quot;: 10\n})\n\ntask_id = response[&quot;id&quot;]\n\n# \u8f6e\u8be2\u7ed3\u679c\nimport time\nwhile True:\n    result = client.get(f&quot;\/v1\/video\/{task_id}&quot;)\n    if result[&quot;status&quot;] == &quot;completed&quot;:\n        print(f&quot;\u89c6\u9891\u5730\u5740: {result[&#039;url&#039;]}&quot;)\n        break\n    time.sleep(10)<\/code><\/pre>\n<blockquote>\n<p>\u26a0\ufe0f \u5177\u4f53\u89c6\u9891\u6a21\u578b\u652f\u6301\u7684\u53c2\u6570\u6709\u6240\u4e0d\u540c\uff0c\u8bf7\u4ee5\u5b9e\u9645 API \u6587\u6863\u4e3a\u51c6\u3002<\/p>\n<\/blockquote>\n<hr \/>\n<h2>8. \u514d\u8d39\u4f7f\u7528<\/h2>\n<h3>free.yunwu.ai<\/h3>\n<p>\u5982\u679c\u4f60\u53ea\u60f3\u4f53\u9a8c\uff0c\u53ef\u4ee5\u4e0d\u82b1\u4e00\u5206\u94b1\uff1a<\/p>\n<ol>\n<li>\u6253\u5f00 <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/free.yunwu.ai\">free.yunwu.ai<\/a><\/li>\n<li>\u4f7f\u7528 GitHub \u8d26\u53f7\u6388\u6743\u767b\u5f55<\/li>\n<li>\u83b7\u53d6\u514d\u8d39 API Key\uff08\u540c\u4e0a\u4f7f\u7528\u65b9\u6cd5\uff0cbase_url \u4e0d\u53d8\uff09<\/li>\n<li>\u6bcf\u65e5\u514d\u8d39\u989d\u5ea6\u81ea\u52a8\u5237\u65b0<\/li>\n<\/ol>\n<h3>\u514d\u8d39\u914d\u989d\u793a\u4f8b<\/h3>\n<table>\n<thead>\n<tr>\n<th>\u6a21\u578b<\/th>\n<th>\u6bcf\u65e5\u514d\u8d39\u8c03\u7528\u6b21\u6570<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>gpt-4o<\/code><\/td>\n<td>~30<\/td>\n<\/tr>\n<tr>\n<td><code>gpt-4o-mini<\/code><\/td>\n<td>~200<\/td>\n<\/tr>\n<tr>\n<td><code>deepseek-v3<\/code> \/ <code>deepseek-r1<\/code><\/td>\n<td>~30<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<hr \/>\n<h2>9. \u5e38\u89c1\u95ee\u9898<\/h2>\n<h3>Q: \u652f\u6301\u6d41\u5f0f\u8f93\u51fa\u5417\uff1f<\/h3>\n<p>A: \u652f\u6301\u3002\u6240\u6709\u5bf9\u8bdd\u6a21\u578b\u5747\u652f\u6301 SSE\uff08Server-Sent Events\uff09\u6d41\u5f0f\u8f93\u51fa\uff0c\u548c OpenAI \u5b98\u65b9\u4f53\u9a8c\u4e00\u81f4\u3002<\/p>\n<h3>Q: API \u8c03\u7528\u62a5 401 \u9519\u8bef\u600e\u4e48\u529e\uff1f<\/h3>\n<p>A: \u68c0\u67e5 <code>Authorization<\/code> \u5934\u662f\u5426\u6b63\u786e\uff0c\u683c\u5f0f\u4e3a <code>Bearer &lt;API_Key&gt;<\/code>\uff08\u6ce8\u610f Bearer \u540e\u6709\u7a7a\u683c\uff09\u3002\u786e\u8ba4 API Key \u6ca1\u6709\u8fc7\u671f\uff0c\u4e14\u5728\u63a7\u5236\u53f0\u672a\u88ab\u64a4\u9500\u3002<\/p>\n<h3>Q: \u652f\u6301 function calling \/ tools \u5417\uff1f<\/h3>\n<p>A: \u652f\u6301\u3002\u4efb\u4f55\u539f\u751f\u652f\u6301 function calling \u7684\u6a21\u578b\uff08\u5982 GPT-5\u3001Claude \u7b49\uff09\u90fd\u53ef\u4ee5\u901a\u8fc7\u6807\u51c6 OpenAI tool \u53c2\u6570\u8c03\u7528\u3002<\/p>\n<h3>Q: \u5e76\u53d1\u6709\u9650\u5236\u5417\uff1f<\/h3>\n<p>A: \u5b98\u65b9\u5ba3\u79f0\u65e0\u5e76\u53d1\u9650\u5236\uff0c\u4f46\u5b9e\u9645\u4f53\u9a8c\u53ef\u80fd\u53d7\u8d26\u6237\u7b49\u7ea7\u5f71\u54cd\u3002<\/p>\n<h3>Q: \u5982\u4f55\u67e5\u770b\u4f59\u989d\u548c\u7528\u91cf\uff1f<\/h3>\n<p>A: \u767b\u5f55 <a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/yunwu.ai\">yunwu.ai<\/a> \u63a7\u5236\u53f0\u5373\u53ef\u67e5\u770b\u5b9e\u65f6\u4f59\u989d\u3001\u5386\u53f2\u8c03\u7528\u8bb0\u5f55\u548c token \u6d88\u8017\u660e\u7ec6\u3002<\/p>\n<h3>Q: \u9000\u6b3e\u600e\u4e48\u5904\u7406\uff1f<\/h3>\n<p>A: \u5145\u503c\u4f59\u989d\u4e0d\u652f\u6301\u63d0\u73b0\/\u9000\u6b3e\uff08\u8fd9\u662f\u5927\u90e8\u5206\u4e2d\u8f6c\u7ad9\u7684\u901a\u884c\u505a\u6cd5\uff09\uff0c\u5efa\u8bae\u5148 1 \u5143\u8d77\u5145\u4f53\u9a8c\u3002<\/p>\n<h3>Q: \u6570\u636e\u5b89\u5168\u5417\uff1f<\/h3>\n<p>A: \u4e2d\u8f6c\u7ad9\u53ef\u4ee5\u770b\u5230\u4f60\u53d1\u9001\u7684\u5185\u5bb9\u3002\u5982\u679c\u6d89\u53ca\u654f\u611f\u6570\u636e\uff0c\u5efa\u8bae\u76f4\u63a5\u4f7f\u7528\u6a21\u578b\u5b98\u65b9 API\uff0c\u6216\u5bf9\u654f\u611f\u5185\u5bb9\u505a\u672c\u5730\u8131\u654f\u5904\u7406\u3002<\/p>\n<hr \/>\n<h2>\u5feb\u901f\u4e0a\u624b\u603b\u7ed3<\/h2>\n<pre><code class=\"language-python\"># \u4e09\u884c\u4ee3\u7801\uff0c\u5373\u53ef\u5f00\u59cb\u4f7f\u7528\nfrom openai import OpenAI\nclient = OpenAI(base_url=&quot;https:\/\/yunwu.ai\/v1&quot;, api_key=&quot;\u4f60\u7684API_KEY&quot;)\nprint(client.chat.completions.create(model=&quot;gpt-5.2&quot;, messages=[{&quot;role&quot;:&quot;user&quot;,&quot;content&quot;:&quot;\u4f60\u597d\uff01&quot;}]).choices[0].message.content)<\/code><\/pre>\n<blockquote>\n<p>\ud83d\udd17 \u5b98\u7f51\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/yunwu.ai\">yunwu.ai<\/a> | \u514d\u8d39\u7248\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/free.yunwu.ai\">free.yunwu.ai<\/a> | \u6587\u6863\u7ad9\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/yunwu.apifox.cn\">yunwu.apifox.cn<\/a><\/p>\n<\/blockquote>\n<hr \/>\n<p><em>\u672c\u6559\u7a0b\u57fa\u4e8e\u516c\u5f00\u4fe1\u606f\u6574\u7406\uff0c\u5177\u4f53\u529f\u80fd\u4e0e\u5b9a\u4ef7\u4ee5\u5b98\u7f51\u6700\u65b0\u516c\u544a\u4e3a\u51c6\u3002<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e91\u96fe API (yunwu.ai) \u4f7f\u7528\u6559\u7a0b \u9ad8\u901f\u3001\u7a33\u5b9a\u7684 AI API \u4e2d\u8f6c\u7ad9 \u2014 \u65e0\u9700\u4ee3\u7406\uff0c\u76f4\u8fde\u5168\u7403 AI [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-227","post","type-post","status-publish","format-standard","hentry","category-ai-"],"_links":{"self":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts\/227","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/comments?post=227"}],"version-history":[{"count":1,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts\/227\/revisions"}],"predecessor-version":[{"id":228,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/posts\/227\/revisions\/228"}],"wp:attachment":[{"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/media?parent=227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/categories?post=227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mumudlin.com\/index.php\/wp-json\/wp\/v2\/tags?post=227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}