{"id":13457214,"url":"https://github.com/zuisong/gemini-openai-proxy","last_synced_at":"2025-05-15T20:05:58.324Z","repository":{"id":215395673,"uuid":"738821930","full_name":"zuisong/gemini-openai-proxy","owner":"zuisong","description":"OpenAI to Google Gemini         https://gemini-openai-proxy.deno.dev","archived":false,"fork":false,"pushed_at":"2025-04-03T10:05:16.000Z","size":2669,"stargazers_count":395,"open_issues_count":1,"forks_count":112,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-04-08T06:35:46.058Z","etag":null,"topics":["ai","bun","chatgpt-api","deno","deno-deploy","gemini-pro","gemini-pro-vision","gemini-protocol","hono","node","openai-api","serverless"],"latest_commit_sha":null,"homepage":"https://gemini-openai-proxy.zuisong.workers.dev","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zuisong.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-04T05:58:46.000Z","updated_at":"2025-04-07T02:34:35.000Z","dependencies_parsed_at":"2024-01-17T17:23:51.174Z","dependency_job_id":"b195b5e1-b3c4-4cc3-8080-0c7ae440e24f","html_url":"https://github.com/zuisong/gemini-openai-proxy","commit_stats":{"total_commits":184,"total_committers":9,"mean_commits":"20.444444444444443","dds":"0.29891304347826086","last_synced_commit":"7b150af571a5a0138bfe4c4fb34b15fd2b765647"},"previous_names":["zuisong/gemini-openai-proxy"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Fgemini-openai-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Fgemini-openai-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Fgemini-openai-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zuisong%2Fgemini-openai-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zuisong","download_url":"https://codeload.github.com/zuisong/gemini-openai-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414499,"owners_count":22067272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bun","chatgpt-api","deno","deno-deploy","gemini-pro","gemini-pro-vision","gemini-protocol","hono","node","openai-api","serverless"],"created_at":"2024-07-31T08:01:36.026Z","updated_at":"2025-05-15T20:05:53.257Z","avatar_url":"https://github.com/zuisong.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Gemini-OpenAI-Proxy\n\nGemini-OpenAI-Proxy is a proxy software. It is designed to convert OpenAI API\nprotocol calls into Google Gemini Pro protocol, so that software using OpenAI\nprotocol can use Gemini Pro model without perception.\n\nIf you're interested in using Google Gemini but don't want to modify your\nsoftware, Gemini-OpenAI-Proxy is a great option. It allows you to easily\nintegrate the powerful features of Google Gemini without having to do any\ncomplex development work.\n\n## Demo\n\n\u003e Get api key from \u003chttps://makersuite.google.com/app/apikey\u003e\n\n\u003cdetails open\u003e\n\n\u003csummary\u003e✅ Gemini Pro\u003c/summary\u003e\n\n```shell\ncurl -s http://localhost:8000/v1/chat/completions \\\n  -H \"Authorization: Bearer $YOUR_GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n      \"model\": \"gpt-3.5-turbo\",\n      \"messages\": [{\"role\": \"user\", \"content\": \"Hello, Who are you?\"}],\n      \"temperature\": 0.7\n      }'\n```\n\n![demo](./assets/demo.png)\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003e✅ Gemini Pro Vision\u003c/summary\u003e\n\n```shell\ncurl -s http://localhost:8000/v1/chat/completions \\\n  -H \"Authorization: Bearer $YOUR_GEMINI_API_KEY\" \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\n  \"model\": \"gpt-4-vision-preview\",\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\": [\n        {\n          \"type\": \"text\",\n          \"text\": \"What do you see in this picture?\"\n        },\n        {\n          \"type\": \"image_url\",\n          \"image_url\": {\n            \"url\": \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAnAgMAAAA0vyM3AAAACVBMVEX/4WwCAgF3aTMcpbzGAAAAa0lEQVR4nGOgAWB1QOYEIHFEcXKmhCBxQqYgcSLEEGymAFEEhzFAFYmTwNoA53A6IDmB1YETidPAiLBVFGgEgrNqJYIzNTQU4Z5QZA6QNQ3hGpAZcNegceBOADFQOQlQDhfQyUwLkPxKVwAABbkRCcDA66QAAAAASUVORK5CYII=\"\n          }\n        }\n      ]\n    }\n  ],\n  \"stream\": false\n}'\n```\n\n![vision demo](./assets/vision-demo.jpeg)\n\n\u003c/details\u003e\n\n## Plan\n\n- [x] `/v1/chat/completions`\n  - [x] stream\n  - [x] complete\n\n## Model Mappings\n\n| Request Model        | Target Gemini Model        |\n| -------------------- | -------------------------- |\n| gpt-3.5-turbo        | gemini-1.5-flash-8b-latest |\n| gpt-4                | gemini-1.5-pro-latest      |\n| gpt-4o               | gemini-1.5-flash-latest    |\n| gpt-4o-mini          | gemini-1.5-flash-8b-latest |\n| gpt-4-vision-preview | gemini-1.5-flash-latest    |\n| gpt-4-turbo          | gemini-1.5-pro-latest      |\n| gpt-4-turbo-preview  | gemini-2.0-flash-exp       |\n| gemini*              | gemini*                    |\n| ...(others)          | gemini-1.5-flash-latest    |\n\n## Run On Serverless\n\n### [Cloudflare Workers](https://workers.cloudflare.com)\n\n\u003e build command `npm run build:cf_worker`\n\nCopy [`main_cloudflare-workers.mjs`](./dist/main_cloudflare-workers.mjs) to\n`cloudflare-workers`\n\n### [Deno Deploy](https://deno.com/deploy)\n\n\u003e build command `npm run build:deno`\n\nCopy [`main_deno.mjs`](./dist/main_deno.mjs) to `deno deploy`\n\n### [Vercel](https://vercel.com)\n\n\u003e build command `npm run build:cf_worker`\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/zuisong/gemini-openai-proxy\u0026repository-name=gemini-openai-proxy)\n\n- Alternatively can be deployed with [cli](https://vercel.com/docs/cli):\n  `vercel deploy`\n- Serve locally: `vercel dev`\n- Vercel _Functions_\n  [limitations](https://vercel.com/docs/functions/limitations) (with _Edge_\n  runtime)\n\n## Run On Local\n\n### deno\n\n```shell\ndeno task start:deno\n```\n\n### node\n\n```shell\nnpm install \u0026\u0026 npm run start:node\n```\n\n### bun\n\n```shell\nbun run start:bun\n```\n\n### docker\n\n```shell\ndocker run -d -p 8000:8000 ghcr.io/zuisong/gemini-openai-proxy:deno\n## or\ndocker run -d -p 8000:8000 ghcr.io/zuisong/gemini-openai-proxy:bun\n## or\ndocker run -d -p 8000:8000 ghcr.io/zuisong/gemini-openai-proxy:node\n```\n\n## Star History\n\n\u003ca href=\"https://star-history.com/#zuisong/gemini-openai-proxy\u0026Date\"\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://api.star-history.com/svg?repos=zuisong/gemini-openai-proxy\u0026type=Date\u0026theme=dark\" /\u003e\n    \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://api.star-history.com/svg?repos=zuisong/gemini-openai-proxy\u0026type=Date\" /\u003e\n    \u003cimg alt=\"Star History Chart\" src=\"https://api.star-history.com/svg?repos=zuisong/gemini-openai-proxy\u0026type=Date\" /\u003e\n  \u003c/picture\u003e\n\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuisong%2Fgemini-openai-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzuisong%2Fgemini-openai-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzuisong%2Fgemini-openai-proxy/lists"}