Volver al ranking

PublicAffairs/openai-gemini

JavaScriptmy-openai-gemini-demo.vercel.app

✦ Gemini ➜ OpenAI API proxy. Serverless!

chatgpt-apigemini-aiopenaiproxyserverlessgemini
Crecimiento de estrellas
Estrellas
3.6k
Forks
5.9k
Crecimiento semanal
Issues
9
1k2k3k
feb 2024nov 2024sept 2025jul 2026
Artefactosnpmnpm install openai-gemini
README

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).

[!TIP] Running the proxy endpoint locally is also an option!

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

Deploy with Vercel

  • Alternatively can be deployed with cli: vercel deploy
  • Serve locally: vercel dev
  • Vercel Functions limitations (with Edge runtime)

Deploy to Netlify

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/completions endpoint)
      Functions limits
    • /edge/v1
      Edge functions limits

Deploy to Cloudflare

Deploy to Cloudflare Workers

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-", or "models/". Otherwise, these defaults apply:

  • chat/completions: gemini-flash-latest
  • embeddings: gemini-embedding-001

Built-in tools

To use the web search tool, append ":search" to the model name (e.g., "gemini-2.5-flash:search").

Note: The annotations message 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_body field. The most notable of these is thinking_config.

For more details, refer to the Gemini API docs.


Supported API endpoints and applicable parameters

  • chat/completions

    Currently, most of the parameters that are applicable to both APIs have been implemented.

    • messages
      • content
      • role
        • "system" (=>system_instruction)
        • "user"
        • "assistant"
        • "tool"
      • tool_calls
    • model
    • frequency_penalty
    • logit_bias
    • logprobs
    • top_logprobs
    • max_tokens, max_completion_tokens
    • n (candidateCount <8, not for streaming)
    • presence_penalty
    • reasoning_effort
    • response_format
      • "json_object"
      • "json_schema" (a select subset of an OpenAPI 3.0 schema object)
      • "text"
    • seed
    • stop: string|array (stopSequences [1,5])
    • stream
    • stream_options
      • include_usage
    • temperature (0.0..2.0 for OpenAI, but Gemini supports up to infinity)
    • top_p
    • tools
    • tool_choice
    • parallel_tool_calls (is always active in Gemini)
    • extra_body
  • completions

  • embeddings

    • dimensions
  • models

Repositorios relacionados
f/awesome-chatgpt-prompts

This repo includes ChatGPT prompt curation to use ChatGPT and other LLM tools better.

HTMLCreative Commons Zero v1.0 Universalchatbotchatgpt
prompts.chat
121.3k16.3k
xtekky/gpt4free

The official gpt4free repository | various collection of powerful language models | opus 4.6 gpt 5.3 kimi 2.5 deepseek v3.2 gemini 3

PythonPyPIGNU General Public License v3.0chatgptchatgpt-4
t.me/g4f_channel
66.5k13.5k
mouredev/Hello-Python

Curso para aprender el lenguaje de programación Python desde cero y para principiantes. 100 clases, 44 horas en vídeo, código, proyectos y grupo de chat. Fundamentos, frontend, backend, testing, IA...

PythonPyPIApache License 2.0fastapimongodb
mouredev.link/python
36.5k2.3k
GaiZhenbiao/ChuanhuChatGPT

GUI for ChatGPT API and many LLMs. Supports agents, file-based QA, GPT finetuning and query with web search. All with a neat UI.

PythonPyPIGNU General Public License v3.0chatbotchatgpt-api
huggingface.co/spaces/JohnSmith9982/ChuanhuChatGPT
15.3k2.2k
sashabaranov/go-openai

OpenAI ChatGPT, GPT-5, GPT-Image-1, Whisper API clients for Go

GoGo ModulesApache License 2.0goopenai
10.7k1.7k
rockbenben/ChatGPT-Shortcut

🚀💪Maximize your efficiency and productivity. The ultimate hub to manage, customize, and share prompts. (English/中文/Español/العربية). 让生产力加倍的 AI 快捷指令。更高效地管理提示词,在分享社区中发现适用于不同场景的灵感。

TypeScriptnpmMIT Licensechatgptprompts
aishort.top/en
8.6k947
zilliztech/GPTCache

Semantic cache for LLMs. Fully integrated with LangChain and llama_index.

PythonPyPIMIT Licensechatbotchatgpt
gptcache.readthedocs.io
8.1k587
reorx/awesome-chatgpt-api

Curated list of apps and tools that not only use the new ChatGPT API, but also allow users to configure their own API keys, enabling free and on-demand usage of their own quota.

PythonPyPIawesomeawesome-list
6.4k430
promptslab/Awesome-Prompt-Engineering

This repository contains a hand-curated resources for Prompt Engineering with a focus on Generative Pre-trained Transformer (GPT), ChatGPT, PaLM etc

TypeScriptnpmApache License 2.0chatgptchatgpt-api
discord.gg/m88xfYMbK6
6.2k728
EwingYangs/awesome-open-gpt

Collection of Open Source Projects Related to GPT,GPT相关开源项目合集🚀、精选🔥🔥

PythonPyPIaigcchatgpt
6k543
PawanOsman/ChatGPT

OpenAI API Free Reverse Proxy

TypeScriptnpmGNU Affero General Public License v3.0aiapi
discord.pawan.krd
5.7k1k
ConnectAI-E/feishu-openai

🎒 飞书 ×(GPT-4 + GPT-4V + DALL·E-3 + Whisper)= 飞一般的工作体验 🚀 语音对话、角色扮演、多话题讨论、图片创作、表格分析、文档导出 🚀

GoGo ModulesGNU General Public License v3.0chatgptfeishu-bot
feishu.market
5.6k928