[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72685":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":15,"compositeScore":20,"rankGlobal":10,"rankLanguage":10,"license":21,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":22,"hasPages":22,"topics":24,"createdAt":10,"pushedAt":10,"updatedAt":31,"readmeContent":32,"aiSummary":33,"trendingCount":16,"starSnapshotCount":16,"syncStatus":34,"lastSyncTime":35,"discoverSource":36},72685,"openai-gemini","PublicAffairs\u002Fopenai-gemini","PublicAffairs","✦ Gemini ➜ OpenAI API proxy. Serverless!","https:\u002F\u002Fmy-openai-gemini-demo.vercel.app\u002F",null,"JavaScript",3578,5942,12,9,0,3,14,48,79.8,"MIT License",false,"main",[25,26,27,28,29,30],"chatgpt-api","gemini","gemini-ai","openai","proxy","serverless","2026-06-12 04:01:06","## Why\n\nThe Gemini API has [Free](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fpricing#free) Tier\nwith *generous limits*, but there are still many tools that work exclusively with the OpenAI API.\n\nThis project provides a personal OpenAI-compatible endpoint for free.\n\n\n## Serverless?\n\nAlthough it runs in the cloud, it does not require server maintenance.\nIt can be easily deployed to various providers for free\n(with generous limits suitable for personal use).\n\n> [!TIP]\n> Running the proxy endpoint locally is also an [option](#serve-locally---with-node-deno-bun)!\n\n\n## How to start\n\nYou will need a personal Google [API key](https:\u002F\u002Faistudio.google.com\u002Fapp\u002Fapi-keys).\n\n> [!IMPORTANT]\n> Even if you are located outside of the [supported regions](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Favailable-regions#available_regions),\n> it is still possible to acquire one using a VPN.\n\nDeploy the project to one of the providers, using the instructions below.\nYou will need to set up an account there.\n\nIf you opt for “button-deploy”, you'll be guided through the process of forking the repository first,\nwhich is necessary for continuous integration (CI).\n\n\n### Deploy with Vercel\n\n [![Deploy with Vercel](https:\u002F\u002Fvercel.com\u002Fbutton)](https:\u002F\u002Fvercel.com\u002Fnew\u002Fclone?repository-url=https:\u002F\u002Fgithub.com\u002FPublicAffairs\u002Fopenai-gemini&repository-name=my-openai-gemini)\n- Alternatively can be deployed with [cli](https:\u002F\u002Fvercel.com\u002Fdocs\u002Fcli):\n  `vercel deploy`\n- Serve locally: `vercel dev`\n- Vercel _Functions_ [limitations](https:\u002F\u002Fvercel.com\u002Fdocs\u002Ffunctions\u002Flimitations) (with _Edge_ runtime)\n\n\n### Deploy to Netlify\n\n[![Deploy to Netlify](https:\u002F\u002Fwww.netlify.com\u002Fimg\u002Fdeploy\u002Fbutton.svg)](https:\u002F\u002Fapp.netlify.com\u002Fstart\u002Fdeploy?repository=https:\u002F\u002Fgithub.com\u002FPublicAffairs\u002Fopenai-gemini&integrationName=integrationName&integrationSlug=integrationSlug&integrationDescription=integrationDescription)\n- Alternatively can be deployed with [cli](https:\u002F\u002Fdocs.netlify.com\u002Fcli\u002Fget-started\u002F):\n  `netlify deploy`\n- Serve locally: `netlify dev`\n- Two different api bases provided:\n  - `\u002Fv1` (e.g. `\u002Fv1\u002Fchat\u002Fcompletions` endpoint)  \n    _Functions_ [limits](https:\u002F\u002Fdocs.netlify.com\u002Fbuild\u002Ffunctions\u002Fget-started\u002F#synchronous-function)\n  - `\u002Fedge\u002Fv1`  \n    _Edge functions_ [limits](https:\u002F\u002Fdocs.netlify.com\u002Fbuild\u002Fedge-functions\u002Flimits\u002F)\n\n\n### Deploy to Cloudflare\n\n[![Deploy to Cloudflare Workers](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002Fbutton)](https:\u002F\u002Fdeploy.workers.cloudflare.com\u002F?url=https:\u002F\u002Fgithub.com\u002FPublicAffairs\u002Fopenai-gemini)\n- Alternatively can be deployed manually pasting content of [`src\u002Fworker.mjs`](src\u002Fworker.mjs)\n  to https:\u002F\u002Fworkers.cloudflare.com\u002Fplayground (see there `Deploy` button).\n- Alternatively can be deployed with [cli](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fwrangler\u002F):\n  `wrangler deploy`\n- Serve locally: `wrangler dev`\n- _Worker_ [limits](https:\u002F\u002Fdevelopers.cloudflare.com\u002Fworkers\u002Fplatform\u002Flimits\u002F#worker-limits)\n\n\n### Deploy to Deno\n\nSee details [here](https:\u002F\u002Fgithub.com\u002FPublicAffairs\u002Fopenai-gemini\u002Fdiscussions\u002F19).\n\n\n### Serve locally - with Node, Deno, Bun\n\nOnly for Node: `npm install`.\n\nThen `npm run start` \u002F `npm run start:deno` \u002F `npm run start:bun`.\n\n\n#### Dev mode (watch source changes)\n\nOnly for Node: `npm install --include=dev`\n\nThen: `npm run dev` \u002F `npm run dev:deno` \u002F `npm run dev:bun`.\n\n\n## How to use\nIf you open your newly-deployed site in a browser, you will only see a `404 Not Found` message. This is expected, as the API is not designed for direct browser access.\nTo utilize it, you should enter your API address and your Gemini API key into the corresponding fields in your software settings.\n\n> [!NOTE]\n> Not all software tools allow overriding the OpenAI endpoint, but many do\n> (however these settings can sometimes be deeply hidden).\n\nTypically, you should specify the API base in this format:  \n`https:\u002F\u002Fmy-super-proxy.vercel.app\u002Fv1`\n\nThe relevant field may be labeled as \"_OpenAI proxy_\".\nYou might need to look under \"_Advanced settings_\" or similar sections.\nAlternatively, it could be in some config file (check the relevant documentation for details).\n\nFor some command-line tools, you may need to set an environment variable, _e.g._:\n```sh\nOPENAI_BASE_URL=\"https:\u002F\u002Fmy-super-proxy.vercel.app\u002Fv1\"\n```\n_..or_:\n```sh\nOPENAI_API_BASE=\"https:\u002F\u002Fmy-super-proxy.vercel.app\u002Fv1\"\n```\n\n\n## Models\n\nRequests use the specified [model] if its name starts with \"gemini-\", \"gemma-\", or \"models\u002F\".\nOtherwise, these defaults apply:\n\n- `chat\u002Fcompletions`: `gemini-flash-latest`\n- `embeddings`: `gemini-embedding-001`\n\n[model]: https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fmodels\n\n\n## Built-in tools\n\nTo use the **web search** tool, append \":search\" to the model name\n(e.g., \"gemini-2.5-flash:search\").\n\nNote: The `annotations` message property is not implemented.\n\n\n## Media\n\n[Vision] and [audio] input supported as per OpenAI [specs].\nImplemented via [`inlineData`](https:\u002F\u002Fai.google.dev\u002Fapi\u002Fcaching#Part).\n\n[vision]: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Fimages-vision?api-mode=chat&format=url#giving-a-model-images-as-input\n[audio]: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fguides\u002Faudio?example=audio-in&lang=curl#add-audio-to-your-existing-application\n[specs]: https:\u002F\u002Fplatform.openai.com\u002Fdocs\u002Fapi-reference\u002Fchat\u002Fcreate\n\n\n## Gemini-specific functions\n\nThere are several features supported by Gemini that are not available in OpenAI models\nbut can be enabled using the `extra_body` field.\nThe most notable of these is [`thinking_config`](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fopenai#thinking).\n\nFor more details, refer to the [Gemini API docs](https:\u002F\u002Fai.google.dev\u002Fgemini-api\u002Fdocs\u002Fopenai#extra-body).\n\n---\n\n## Supported API endpoints and applicable parameters\n\n- [x] `chat\u002Fcompletions`\n\n  Currently, most of the parameters that are applicable to both APIs have been implemented.\n  \u003Cdetails>\n\n  - [x] `messages`\n      - [x] `content`\n      - [x] `role`\n          - [x] \"system\" (=>`system_instruction`)\n          - [x] \"user\"\n          - [x] \"assistant\"\n          - [x] \"tool\"\n      - [x] `tool_calls`\n  - [x] `model`\n  - [x] `frequency_penalty`\n  - [ ] `logit_bias`\n  - [ ] `logprobs`\n  - [ ] `top_logprobs`\n  - [x] `max_tokens`, `max_completion_tokens`\n  - [x] `n` (`candidateCount` \u003C8, not for streaming)\n  - [x] `presence_penalty`\n  - [x] `reasoning_effort`\n  - [x] `response_format`\n      - [x] \"json_object\"\n      - [x] \"json_schema\" (a select subset of an OpenAPI 3.0 schema object)\n      - [x] \"text\"\n  - [x] `seed`\n  - [x] `stop`: string|array (`stopSequences` [1,5])\n  - [x] `stream`\n  - [x] `stream_options`\n      - [x] `include_usage`\n  - [x] `temperature` (0.0..2.0 for OpenAI, but Gemini supports up to infinity)\n  - [x] `top_p`\n  - [x] `tools`\n  - [x] `tool_choice`\n  - [ ] `parallel_tool_calls` (is always active in Gemini)\n  - [x] [`extra_body`](#gemini-specific-functions)\n\n  \u003C\u002Fdetails>\n- [ ] `completions`\n- [x] `embeddings`\n  - [x] `dimensions`\n- [x] `models`\n","PublicAffairs\u002Fopenai-gemini 是一个提供与OpenAI API兼容的Gemini API代理服务，采用无服务器架构。项目核心功能是通过创建个人的OpenAI兼容端点，让用户能够免费利用Gemini API提供的丰富资源，而无需直接支持OpenAI API。技术上基于JavaScript开发，并且设计为完全无服务器运行，这意味着用户不需要维护自己的服务器，可轻松部署到Vercel、Netlify、Cloudflare Workers等平台。此外，还支持本地运行选项。该项目非常适合那些希望在不改变现有工具或应用程序的前提下探索和使用Gemini AI能力的开发者和个人用户。",2,"2026-06-11 03:43:11","high_star"]