The Gemini API has Free Tier
with generous limits, but there are still 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!
[!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
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.:
There are several features supported by Gemini that are not available in OpenAI models
but can be enabled using the extra_body field.
The most notable of these is thinking_config.
Why
The Gemini API has Free Tier with generous limits, but there are still 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).
How to start
You will need a personal Google API key.
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
vercel deployvercel devDeploy to Netlify
netlify deploynetlify dev/v1(e.g./v1/chat/completionsendpoint)Functions limits
/edge/v1Edge functions limits
Deploy to Cloudflare
src/worker.mjsto https://workers.cloudflare.com/playground (see thereDeploybutton).wrangler deploywrangler devDeploy 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=devThen:
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 Foundmessage. 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.Typically, you should specify the API base in this format:
https://my-super-proxy.vercel.app/v1The 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.:
..or:
Models
Requests use the specified model if its name starts with “gemini-“, “gemma-“, or “models/“. Otherwise, these defaults apply:
chat/completions:gemini-flash-latestembeddings:gemini-embedding-001Built-in tools
To use the web search tool, append “:search” to the model name (e.g., “gemini-2.5-flash:search”).
Note: The
annotationsmessage property is not implemented.Media
Vision and audio input supported as per OpenAI specs. Implemented via
inlineData.Gemini-specific functions
There are several features supported by Gemini that are not available in OpenAI models but can be enabled using the
extra_bodyfield. The most notable of these isthinking_config.For more details, refer to the Gemini API docs.
Supported API endpoints and applicable parameters
chat/completionsCurrently, most of the parameters that are applicable to both APIs have been implemented.
messagescontentrolesystem_instruction)tool_callsmodelfrequency_penaltylogit_biaslogprobstop_logprobsmax_tokens,max_completion_tokensn(candidateCount<8, not for streaming)presence_penaltyreasoning_effortresponse_formatseedstop: string|array (stopSequences[1,5])streamstream_optionsinclude_usagetemperature(0.0..2.0 for OpenAI, but Gemini supports up to infinity)top_ptoolstool_choiceparallel_tool_calls(is always active in Gemini)extra_bodycompletionsembeddingsdimensionsmodels