{"id":32460,"date":"2025-07-15T14:03:10","date_gmt":"2025-07-15T06:03:10","guid":{"rendered":"https:\/\/www.kdjingpai.com\/?p=32460"},"modified":"2025-07-15T14:03:10","modified_gmt":"2025-07-15T06:03:10","slug":"geminicli2api","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/de\/geminicli2api\/","title":{"rendered":"geminicli2api\uff1a\u5c06 Gemini CLI \u8f6c\u4e3a OpenAI \u517c\u5bb9 API \u7684\u4ee3\u7406\u5de5\u5177"},"content":{"rendered":"<p>geminicli2api \u662f\u4e00\u4e2a\u57fa\u4e8e FastAPI \u7684\u5f00\u6e90\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u6258\u7ba1\u5728 GitHub \u4e0a\u3002\u5b83\u5c06 Google <a href=\"https:\/\/www.kdjingpai.com\/geminibardgubu\/\">Gemini<\/a> CLI \u7684\u529f\u80fd\u8f6c\u6362\u4e3a OpenAI \u517c\u5bb9\u7684 API \u63a5\u53e3\uff0c\u540c\u65f6\u652f\u6301\u539f\u751f <a href=\"https:\/\/www.kdjingpai.com\/google-ai-studioai\/\">Gemini API<\/a> \u7aef\u70b9\u3002\u5f00\u53d1\u8005\u53ef\u901a\u8fc7\u719f\u6089\u7684 OpenAI API \u683c\u5f0f\u6216\u76f4\u63a5\u7684 Gemini API \u8c03\u7528 Google Gemini \u6a21\u578b\uff0c\u514d\u8d39\u4f7f\u7528 Google \u63d0\u4f9b\u7684 API \u914d\u989d\u3002\u9879\u76ee\u652f\u6301\u6587\u672c\u751f\u6210\u3001\u591a\u6a21\u6001\u8f93\u5165\uff08\u5982\u6587\u672c\u548c\u56fe\u50cf\uff09\u3001\u5b9e\u65f6\u6d41\u5f0f\u54cd\u5e94\u7b49\u529f\u80fd\u3002\u5b83\u63d0\u4f9b\u591a\u79cd\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u9002\u5408\u5feb\u901f\u90e8\u7f72\u5230\u672c\u5730\u6216\u4e91\u7aef\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u5f00\u53d1\u3001\u6d4b\u8bd5\u548c\u751f\u4ea7\u73af\u5883\u3002geminicli2api \u8bbe\u8ba1\u8f7b\u91cf\uff0c\u6613\u4e8e\u914d\u7f6e\uff0c\u7279\u522b\u9002\u5408\u9700\u8981\u5c06 Gemini \u80fd\u529b\u96c6\u6210\u5230\u73b0\u6709\u5de5\u4f5c\u6d41\u7684\u5f00\u53d1\u8005\u3002<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li>\u63d0\u4f9b OpenAI \u517c\u5bb9\u7684\u00a0<code>\/v1\/chat\/completions<\/code>\u00a0\u548c\u00a0<code>\/v1\/models<\/code>\u00a0\u7aef\u70b9\uff0c\u9002\u914d\u73b0\u6709 OpenAI \u5de5\u5177\u3002<\/li>\n<li>\u652f\u6301\u539f\u751f Gemini API \u7aef\u70b9\uff0c\u5982\u00a0<code>\/v1beta\/models\/{model}:generateContent<\/code>\uff0c\u76f4\u63a5\u8c03\u7528 Gemini \u6a21\u578b\u3002<\/li>\n<li>\u652f\u6301\u5b9e\u65f6\u6d41\u5f0f\u54cd\u5e94\uff0c\u9002\u5408\u4ea4\u4e92\u5f0f\u5bf9\u8bdd\u6216\u957f\u6587\u672c\u751f\u6210\u3002<\/li>\n<li>\u652f\u6301\u591a\u6a21\u6001\u8f93\u5165\uff0c\u5904\u7406\u6587\u672c\u548c\u56fe\u50cf\u7b49\u6df7\u5408\u5185\u5bb9\u3002<\/li>\n<li>\u63d0\u4f9b Google \u641c\u7d22\u589e\u5f3a\u529f\u80fd\uff0c\u901a\u8fc7\u00a0<code>-search<\/code>\u00a0\u6a21\u578b\u53d8\u4f53\u63d0\u4f9b\u66f4\u51c6\u786e\u7684\u54cd\u5e94\u3002<\/li>\n<li>\u652f\u6301\u63a7\u5236 Gemini \u7684\u63a8\u7406\u8fc7\u7a0b\uff0c\u4f7f\u7528\u00a0<code>-nothinking<\/code>\u00a0\u548c\u00a0<code>-maxthinking<\/code>\u00a0\u6a21\u578b\u53d8\u4f53\u8c03\u6574\u63a8\u7406\u6df1\u5ea6\u3002<\/li>\n<li>\u652f\u6301\u591a\u79cd\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u5305\u62ec Bearer \u4ee4\u724c\u3001Basic \u8ba4\u8bc1\u3001API \u5bc6\u94a5\u7b49\u3002<\/li>\n<li>\u652f\u6301 Docker \u5bb9\u5668\u5316\u90e8\u7f72\uff0c\u517c\u5bb9 Hugging Face Spaces\u3002<\/li>\n<\/ul>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<p>geminicli2api \u7684\u5b89\u88c5\u548c\u914d\u7f6e\u7b80\u5355\uff0c\u652f\u6301\u672c\u5730\u8fd0\u884c\u548c\u5bb9\u5668\u5316\u90e8\u7f72\u3002\u4ee5\u4e0b\u662f\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li><strong>\u514b\u9686\u4ed3\u5e93<\/strong><br \/>\n\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u514b\u9686 geminicli2api \u4ed3\u5e93\u5230\u672c\u5730\uff1a<\/p>\n<pre><code>git clone https:\/\/github.com\/gzzhongqi\/geminicli2api\r\ncd geminicli2api\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong><br \/>\n\u9879\u76ee\u57fa\u4e8e Python \u548c FastAPI \u5f00\u53d1\uff0c\u4f9d\u8d56\u5217\u5728\u00a0<code>requirements.txt<\/code>\u00a0\u4e2d\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5\uff1a<\/p>\n<pre><code>pip install -r requirements.txt\r\n<\/code><\/pre>\n<\/li>\n<li><strong>\u914d\u7f6e\u73af\u5883\u53d8\u91cf<\/strong><br \/>\ngeminicli2api \u9700\u914d\u7f6e\u8ba4\u8bc1\u76f8\u5173\u73af\u5883\u53d8\u91cf\u3002\u521b\u5efa\u4e00\u4e2a\u00a0<code>.env<\/code>\u00a0\u6587\u4ef6\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre><code>GEMINI_AUTH_PASSWORD=\u4f60\u7684\u8ba4\u8bc1\u5bc6\u7801\r\nGEMINI_CREDENTIALS={\"client_id\":\"\u4f60\u7684\u5ba2\u6237\u7aefID\",\"client_secret\":\"\u4f60\u7684\u5ba2\u6237\u7aef\u5bc6\u94a5\",\"<a href=\"https:\/\/www.kdjingpai.com\/tokenization\/\">token<\/a>\":\"\u4f60\u7684\u8bbf\u95ee\u4ee4\u724c\",\"refresh_token\":\"\u4f60\u7684\u5237\u65b0\u4ee4\u724c\",\"scopes\":[\"https:\/\/www.googleapis.com\/auth\/cloud-platform\"],\"token_uri\":\"https:\/\/oauth2.googleapis.com\/token\"}\r\nPORT=8888\r\n<\/code><\/pre>\n<ul>\n<li><code>GEMINI_AUTH_PASSWORD<\/code>\uff1aAPI \u8bbf\u95ee\u7684\u8ba4\u8bc1\u5bc6\u7801\uff0c\u5fc5\u586b\u3002<\/li>\n<li><code>GEMINI_CREDENTIALS<\/code>\uff1aGoogle OAuth \u51ed\u636e\u7684 JSON \u5b57\u7b26\u4e32\uff0c\u5305\u542b\u00a0<code>client_id<\/code>\u3001<code>client_secret<\/code>\u00a0\u7b49\u5b57\u6bb5\u3002<\/li>\n<li>\u53ef\u9009\u53d8\u91cf\uff1a\n<ul>\n<li><code>GOOGLE_APPLICATION_CREDENTIALS<\/code>\uff1aGoogle OAuth \u51ed\u636e\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<li><code>GOOGLE_CLOUD_PROJECT<\/code>\u00a0\u6216\u00a0<code>GEMINI_PROJECT_ID<\/code>\uff1aGoogle Cloud \u9879\u76ee ID\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u5982\u679c\u4f7f\u7528\u51ed\u636e\u6587\u4ef6\uff0c\u521b\u5efa\u00a0<code>credentials<\/code>\u00a0\u76ee\u5f55\uff0c\u653e\u5165 Google Cloud \u670d\u52a1\u8d26\u6237\u7684\u00a0<code>.json<\/code>\u00a0\u6587\u4ef6\uff0c\u5e76\u8bbe\u7f6e\u00a0<code>GOOGLE_APPLICATION_CREDENTIALS<\/code>\u00a0\u6307\u5411\u6587\u4ef6\u8def\u5f84\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u672c\u5730\u8fd0\u884c<\/strong><br \/>\n\u914d\u7f6e\u5b8c\u6210\u540e\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u670d\u52a1\uff1a<\/p>\n<pre><code>python -m uvicorn app.main:app --host 0.0.0.0 --port 8888\r\n<\/code><\/pre>\n<p>\u670d\u52a1\u9ed8\u8ba4\u76d1\u542c\u00a0<code>http:\/\/localhost:8888<\/code>\u3002<\/li>\n<li><strong>Docker \u90e8\u7f72<\/strong><br \/>\ngeminicli2api \u652f\u6301 Docker \u5bb9\u5668\u5316\u90e8\u7f72\uff0c\u7b80\u5316\u73af\u5883\u914d\u7f6e\u3002<\/p>\n<ul>\n<li>\u6784\u5efa\u955c\u50cf\uff1a\n<pre><code>docker build -t geminicli2api .\r\n<\/code><\/pre>\n<\/li>\n<li>\u8fd0\u884c\u5bb9\u5668\uff08\u9ed8\u8ba4\u7aef\u53e3 8888\uff09\uff1a\n<pre><code>docker run -p 8888:8888 \\\r\n-e GEMINI_AUTH_PASSWORD=your_password \\\r\n-e GEMINI_CREDENTIALS='{\"client_id\":\"...\",\"token\":\"...\"}' \\\r\n-e PORT=8888 \\\r\ngeminicli2api\r\n<\/code><\/pre>\n<\/li>\n<li>\u4f7f\u7528 Docker Compose\uff1a\n<pre><code>docker-compose up -d\r\n<\/code><\/pre>\n<p>\u5bf9\u4e8e Hugging Face Spaces \u90e8\u7f72\uff0c\u4f7f\u7528\u7aef\u53e3 7860\uff1a<\/p>\n<pre><code>docker-compose --profile hf up -d geminicli2api-hf\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>Hugging Face Spaces \u90e8\u7f72<\/strong>\n<ul>\n<li>\u767b\u5f55 Hugging Face\uff0c\u521b\u5efa\u65b0\u7684 Docker Space\u3002<\/li>\n<li>\u5c06\u4ed3\u5e93\u5185\u5bb9\u4e0a\u4f20\u81f3 Space\u3002<\/li>\n<li>\u5728 Space \u8bbe\u7f6e\u4e2d\u6dfb\u52a0\u73af\u5883\u53d8\u91cf\uff1a<code>GEMINI_AUTH_PASSWORD<\/code>\u00a0\u548c\u00a0<code>GEMINI_CREDENTIALS<\/code>\uff08\u6216\u5176\u4ed6\u51ed\u636e\u6765\u6e90\uff09\u3002<\/li>\n<li>Space \u5c06\u81ea\u52a8\u6784\u5efa\u5e76\u90e8\u7f72\u670d\u52a1\uff0c\u76d1\u542c\u00a0<code>http:\/\/&lt;space-url&gt;:7860<\/code>\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h3>\u4f7f\u7528 API<\/h3>\n<p>geminicli2api \u63d0\u4f9b OpenAI \u517c\u5bb9\u548c\u539f\u751f Gemini API \u7aef\u70b9\uff0c\u5f00\u53d1\u8005\u53ef\u6839\u636e\u9700\u6c42\u9009\u62e9\u3002<\/p>\n<h4>OpenAI \u517c\u5bb9 API<\/h4>\n<p>\u4f7f\u7528 OpenAI \u5ba2\u6237\u7aef\u5e93\u8c03\u7528 geminicli2api\uff0c\u7aef\u70b9\u4e0e OpenAI API \u4e00\u81f4\u3002<br \/>\n<strong>\u793a\u4f8b<\/strong>\uff08Python\uff09\uff1a<\/p>\n<pre><code>import openai\r\nclient = openai.OpenAI(\r\nbase_url=\"http:\/\/localhost:8888\/v1\",\r\napi_key=\"your_password\"  # GEMINI_AUTH_PASSWORD\r\n)\r\nresponse = client.chat.completions.create(\r\nmodel=\"gemini-2.5-pro-maxthinking\",\r\nmessages=[{\"role\": \"user\", \"content\": \"\u7528\u7b80\u5355\u8bed\u8a00\u89e3\u91ca\u76f8\u5bf9\u8bba\"}],\r\nstream=True\r\n)\r\nfor chunk in response:\r\nif chunk.choices[0].delta.reasoning_content:\r\nprint(f\"\u63a8\u7406\u8fc7\u7a0b: {chunk.choices[0].delta.reasoning_content}\")\r\nif chunk.choices[0].delta.content:\r\nprint(chunk.choices[0].delta.content, end=\"\")\r\n<\/code><\/pre>\n<h4>\u539f\u751f Gemini API<\/h4>\n<p>\u76f4\u63a5\u8c03\u7528 Gemini API \u7aef\u70b9\uff0c\u652f\u6301\u66f4\u7075\u6d3b\u7684\u914d\u7f6e\u3002<br \/>\n<strong>\u793a\u4f8b<\/strong>\uff08Python\uff09\uff1a<\/p>\n<pre><code>import requests\r\nheaders = {\r\n\"Authorization\": \"Bearer your_password\",\r\n\"Content-Type\": \"application\/json\"\r\n}\r\ndata = {\r\n\"contents\": [\r\n{\"role\": \"user\", \"parts\": [{\"text\": \"\u7528\u7b80\u5355\u8bed\u8a00\u89e3\u91ca\u76f8\u5bf9\u8bba\"}]}\r\n],\r\n\"thinkingConfig\": {\"thinkingBudget\": 32768, \"includeThoughts\": True}\r\n}\r\nresponse = requests.post(\r\n\"http:\/\/localhost:8888\/v1beta\/models\/gemini-2.5-pro:generateContent\",\r\nheaders=headers,\r\njson=data\r\n)\r\nprint(response.json())\r\n<\/code><\/pre>\n<h4>\u591a\u6a21\u6001\u8f93\u5165<\/h4>\n<p>\u652f\u6301\u4e0a\u4f20\u6587\u672c\u548c\u56fe\u50cf\uff0c\u53d1\u9001\u81f3\u00a0<code>\/v1\/chat\/completions<\/code>\u00a0\u6216\u00a0<code>\/v1beta\/models\/{model}:generateContent<\/code>\u3002<br \/>\n<strong>\u793a\u4f8b<\/strong>\uff08\u4e0a\u4f20\u56fe\u50cf\u548c\u6587\u672c\uff09\uff1a<\/p>\n<pre><code>curl -X POST http:\/\/localhost:8888\/v1\/chat\/completions \\\r\n-H \"Authorization: Bearer your_password\" \\\r\n-H \"Content-Type: application\/json\" \\\r\n-d '{\"model\": \"gemini-2.5-pro\", \"messages\": [{\"role\": \"user\", \"content\": \"\u5206\u6790\u8fd9\u5f20\u56fe\u7247\u5e76\u63cf\u8ff0\u5185\u5bb9\"}], \"files\": [\".\/image.jpg\"]}'\r\n<\/code><\/pre>\n<h4>\u8ba4\u8bc1\u65b9\u5f0f<\/h4>\n<p>\u652f\u6301\u4ee5\u4e0b\u8ba4\u8bc1\u65b9\u5f0f\uff1a<\/p>\n<ul>\n<li><strong>Bearer \u4ee4\u724c<\/strong>\uff1a<code>Authorization: Bearer your_password<\/code><\/li>\n<li><strong>Basic \u8ba4\u8bc1<\/strong>\uff1a<code>Authorization: Basic base64(username:your_password)<\/code><\/li>\n<li><strong>\u67e5\u8be2\u53c2\u6570<\/strong>\uff1a<code>?key=your_password<\/code><\/li>\n<li><strong>Google \u5934\u90e8<\/strong>\uff1a<code>x-goog-api-key: your_password<\/code><\/li>\n<\/ul>\n<h4>\u652f\u6301\u7684\u6a21\u578b<\/h4>\n<ul>\n<li>\u57fa\u7840\u6a21\u578b\uff1a<code>gemini-2.5-pro<\/code>\u3001<code>gemini-2.5-flash<\/code>\u3001<code>gemini-1.5-pro<\/code>\u3001<code>gemini-1.5-flash<\/code>\u3001<code>gemini-1.0-pro<\/code><\/li>\n<li>\u53d8\u4f53\uff1a\n<ul>\n<li><code>-search<\/code>\uff1a\u542f\u7528 Google \u641c\u7d22\u589e\u5f3a\uff08\u5982\u00a0<code>gemini-2.5-pro-search<\/code>\uff09\u3002<\/li>\n<li><code>-nothinking<\/code>\uff1a\u51cf\u5c11\u63a8\u7406\u6b65\u9aa4\uff08\u5982\u00a0<code>gemini-2.5-flash-nothinking<\/code>\uff09\u3002<\/li>\n<li><code>-maxthinking<\/code>\uff1a\u589e\u52a0\u63a8\u7406\u9884\u7b97\uff08\u5982\u00a0<code>gemini-2.5-pro-maxthinking<\/code>\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>\u6ce8\u610f\u4e8b\u9879<\/h3>\n<ul>\n<li>\u786e\u4fdd\u00a0<code>GEMINI_AUTH_PASSWORD<\/code>\u00a0\u5df2\u8bbe\u7f6e\uff0c\u5426\u5219 API \u8bf7\u6c42\u5c06\u5931\u8d25\u3002<\/li>\n<li>Google OAuth \u51ed\u636e\u9700\u6709\u6548\uff0c\u63a8\u8350\u4ece Google Cloud \u63a7\u5236\u53f0\u83b7\u53d6\u3002<\/li>\n<li>\u6d41\u5f0f\u54cd\u5e94\u9700\u5ba2\u6237\u7aef\u652f\u6301\u5206\u5757\u6570\u636e\u5904\u7406\u3002<\/li>\n<li>\u68c0\u67e5 Google Cloud \u9879\u76ee\u914d\u989d\uff0c\u907f\u514d\u8d85\u8fc7 API \u8c03\u7528\u9650\u5236\u3002<\/li>\n<\/ul>\n<h2>\u5e94\u7528\u573a\u666f<\/h2>\n<ol>\n<li><strong>\u96c6\u6210\u73b0\u6709 OpenAI \u5de5\u5177<\/strong><br \/>\n\u5f00\u53d1\u8005\u4f7f\u7528 geminicli2api \u5c06 Gemini \u6a21\u578b\u63a5\u5165\u57fa\u4e8e OpenAI API \u7684\u5de5\u5177\uff08\u5982 LangChain\uff09\uff0c\u65e0\u9700\u4fee\u6539\u4ee3\u7801\uff0c\u5feb\u901f\u5207\u6362\u5230 Gemini \u7684\u514d\u8d39\u914d\u989d\u3002<\/li>\n<li><strong>\u591a\u6a21\u6001\u5185\u5bb9\u751f\u6210<\/strong><br \/>\n\u5185\u5bb9\u521b\u4f5c\u8005\u4e0a\u4f20\u56fe\u50cf\u548c\u6587\u672c\uff0c\u751f\u6210\u63cf\u8ff0\u3001\u5206\u6790\u6216\u521b\u610f\u5185\u5bb9\uff0c\u9002\u5408\u5e7f\u544a\u8bbe\u8ba1\u6216\u6559\u80b2\u7d20\u6750\u5236\u4f5c\u3002<\/li>\n<li><strong>\u81ea\u52a8\u5316\u5de5\u4f5c\u6d41<\/strong><br \/>\n\u4f01\u4e1a\u901a\u8fc7 geminicli2api \u81ea\u52a8\u5316\u5904\u7406\u6587\u6863\u3001\u751f\u6210\u62a5\u544a\u6216\u56de\u7b54\u5ba2\u6237\u67e5\u8be2\uff0c\u63d0\u5347\u8fd0\u8425\u6548\u7387\u3002<\/li>\n<\/ol>\n<h2>QA<\/h2>\n<ol>\n<li><strong>geminicli2api \u652f\u6301\u54ea\u4e9b\u8ba4\u8bc1\u65b9\u5f0f\uff1f<\/strong><br \/>\n\u652f\u6301 Bearer \u4ee4\u724c\u3001Basic \u8ba4\u8bc1\u3001\u67e5\u8be2\u53c2\u6570\u548c Google \u5934\u90e8\u8ba4\u8bc1\uff0c\u9700\u8bbe\u7f6e\u00a0<code>GEMINI_AUTH_PASSWORD<\/code>\u3002<\/li>\n<li><strong>\u5982\u4f55\u83b7\u53d6 Google OAuth \u51ed\u636e\uff1f<\/strong><br \/>\n\u5728 Google Cloud \u63a7\u5236\u53f0\u521b\u5efa\u670d\u52a1\u8d26\u6237\uff0c\u4e0b\u8f7d JSON \u5bc6\u94a5\u6587\u4ef6\uff0c\u586b\u5165\u00a0<code>GEMINI_CREDENTIALS<\/code>\u00a0\u6216\u8bbe\u7f6e\u00a0<code>GOOGLE_APPLICATION_CREDENTIALS<\/code>\u00a0\u8def\u5f84\u3002<\/li>\n<li><strong>\u652f\u6301\u54ea\u4e9b\u6a21\u578b\u53d8\u4f53\uff1f<\/strong><br \/>\n\u652f\u6301\u00a0<code>-search<\/code>\uff08Google \u641c\u7d22\u589e\u5f3a\uff09\u3001<code>-nothinking<\/code>\uff08\u51cf\u5c11\u63a8\u7406\uff09\u3001<code>-maxthinking<\/code>\uff08\u589e\u52a0\u63a8\u7406\uff09\u53d8\u4f53\uff0c\u9002\u7528\u4e8e\u00a0<code>gemini-2.5-pro<\/code>\u00a0\u548c\u00a0<code>gemini-2.5-flash<\/code>\u3002<\/li>\n<li><strong>\u5982\u4f55\u5728 Hugging Face Spaces \u90e8\u7f72\uff1f<\/strong><br \/>\nFork \u4ed3\u5e93\uff0c\u521b\u5efa Docker Space\uff0c\u8bbe\u7f6e\u00a0<code>GEMINI_AUTH_PASSWORD<\/code>\u00a0\u548c\u00a0<code>GEMINI_CREDENTIALS<\/code>\uff0cSpace \u5c06\u81ea\u52a8\u90e8\u7f72\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>geminicli2api \u662f\u4e00\u4e2a\u57fa\u4e8e FastAPI \u7684\u5f00\u6e90\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u6258\u7ba1\u5728 GitHub \u4e0a\u3002\u5b83\u5c06 Google Gemini CLI \u7684\u529f\u80fd\u8f6c\u6362\u4e3a OpenAI \u517c\u5bb9\u7684 API \u63a5\u53e3\uff0c\u540c\u65f6\u652f\u6301\u539f\u751f Gemini API \u7aef\u70b9\u3002\u5f00\u53d1\u8005&#8230;<\/p>\n","protected":false},"author":1,"featured_media":62375,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[230,255],"class_list":["post-32460","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikaiyuanxiangmu","tag-mianfeidamoxingapi"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/32460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/comments?post=32460"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/32460\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media\/62375"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media?parent=32460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/categories?post=32460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/tags?post=32460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}