Why
The Gemini API is free, but there are many tools that work exclusively with the OpenAI API.
This project provides a personal OpenAI-compatible endpoint for free.
Serverless?
Although it runs in the cloud, it does not require server maintenance. It can be easily deployed to various providers for free (with generous limits suitable for personal use).
[!TIP] Running the proxy endpoint locally is also an option, though it’s more appropriate for development use.
How to start
You will need a personal Google API key.
[!IMPORTANT] Even if you are located outside of the supported regions, it is still possible to acquire one using a VPN.
Deploy the project to one of the providers, using the instructions below. You will need to set up an account there.
If you opt for “button-deploy”, you’ll be guided through the process of forking the repository first, which is necessary for continuous integration (CI).
Deploy with Vercel
- Alternatively can be deployed with cli:
vercel deploy - Serve locally:
vercel dev - Vercel Functions limitations (with Edge runtime)
Deploy to Netlify
- Alternatively can be deployed with cli:
netlify deploy - Serve locally:
netlify dev - Two different api bases provided:
/v1(e.g./v1/chat/completionsendpoint)
Functions limits/edge/v1
Edge functions limits
Deploy to Cloudflare
- Alternatively can be deployed manually pasting content of
src/worker.mjsto https://workers.cloudflare.com/playground (see thereDeploybutton). - Alternatively can be deployed with cli:
wrangler deploy - Serve locally:
wrangler dev - Worker limits
Deploy to Deno
See details here.
Serve locally - with Node, Deno, Bun
Only for Node: npm install.
Then npm run start / npm run start:deno / npm run start:bun.
Dev mode (watch source changes)
Only for Node: npm install --include=dev
Then: npm run dev / npm run dev:deno / npm run dev:bun.
How to use
If 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.
To utilize it, you should enter your API address and your Gemini API key into the corresponding fields in your software settings.
[!NOTE] Not all software tools allow overriding the OpenAI endpoint, but many do (however these settings can sometimes be deeply hidden).
Typically, you should specify the API base in this format:
https://my-super-proxy.vercel.app/v1
The relevant field may be labeled as “OpenAI proxy”. You might need to look under “Advanced settings” or similar sections. Alternatively, it could be in some config file (check the relevant documentation for details).
For some command-line tools, you may need to set an environment variable, e.g.:
OPENAI_BASE_URL="https://my-super-proxy.vercel.app/v1"
…or:
OPENAI_API_BASE="https://my-super-proxy.vercel.app/v1"
Models
Requests use the specified model if its name starts with “gemini-”, “gemma-”, “learnlm-”, or “models/”. Otherwise, these defaults apply:
chat/completions:gemini-2.0-flashembeddings:text-embedding-004
Built-in tools
To use the web search tool, append “:search” to the model name (e.g., “gemini-2.0-flash:search”).
Note: The annotations message property is not implemented.
Media
Vision and audio input supported as per OpenAI specs.
Implemented via inlineData.
Supported API endpoints and applicable parameters
[x]
chat/completionsCurrently, most of the parameters that are applicable to both APIs have been implemented.
- [x]
messages- [x]
content - [x]
role- [x] “system” (=>
system_instruction) - [x] “user”
- [x] “assistant”
- [x] “tool”
- [x] “system” (=>
- [ ]
name - [x]
tool_calls
- [x]
- [x]
model - [x]
frequency_penalty - [ ]
logit_bias - [ ]
logprobs - [ ]
top_logprobs - [x]
max_tokens,max_completion_tokens - [x]
n(candidateCount<8, not for streaming) - [x]
presence_penalty - [x]
response_format- [x] “json_object”
- [x] “json_schema” (a select subset of an OpenAPI 3.0 schema object)
- [x] “text”
- [x]
seed - [x]
stop: string|array (stopSequences[1,5]) - [x]
stream - [x]
stream_options- [x]
include_usage
- [x]
- [x]
temperature(0.0…2.0 for OpenAI, but Gemini supports up to infinity) - [x]
top_p - [x]
tools - [x]
tool_choice - [ ]
parallel_tool_calls(is always active in Gemini)
- [x]
[ ]
completions[x]
embeddings[x]
models
OpenAI Gemini Proxy
Project Details
- Uwqn/openai-gemini
- MIT License
- Last Updated: 5/6/2025
Recomended MCP Servers
MCP PostgreSQL Server
mcp
web 接口开发框架,使接口的技术逻辑配置化并解耦接口技术逻辑和业务逻辑。
Sparkmango lets agents generate and use MCP servers from contract ABIs
Autonomous debugging agent MCP server
Simple MCP servers for various Aviation APIs
A comprehensive Model Context Protocol (MCP) server for the Tavus API, enabling AI video generation, replica management, conversational...
Magic admin Python SDK makes it easy to leverage Decentralized ID tokens to protect routes and restricted resources...
Collection of Google-native tools (e.g., Gmail, Calendar) for the MCP





