Expose Google's Gemini models as OpenAI-compatible API endpoints using Cloudflare Workers and OAuth2 authentication.
Gemini CLI OpenAI Worker is a serverless adapter that exposes Google's Gemini AI models through an OpenAI-compatible API. It solves the problem of integrating Gemini models into applications and tools designed for the OpenAI API by providing a translation layer that handles authentication, request formatting, and response streaming. Developers can deploy it on Cloudflare Workers to create their own gateway to Gemini's capabilities.
Developers and teams building AI-powered applications who want to use Google's Gemini models but need compatibility with the OpenAI API ecosystem, including tools like Open WebUI, Cline, and various AI client libraries.
It offers a free, self-hostable alternative to proprietary API gateways, leveraging Google's free tier access via the Code Assist API. The unique OAuth2 authentication method removes the need for traditional API keys, and its deployment on Cloudflare Workers ensures global edge performance with minimal setup.
Expose Gemini CLI endpoints as OpenAI API with Cloudflare Workers
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Eliminates API key management by using Google account credentials via the Gemini CLI, as outlined in the setup requiring OAuth2 tokens from a local credentials file.
Acts as a drop-in replacement for OpenAI endpoints, supporting chat completions, streaming, and tool calling, enabling compatibility with tools like Open WebUI and Cline without code changes.
Provides access to Gemini's latest models with vision support, reasoning capabilities, and automatic fallback between Pro and Flash variants, detailed in the supported models and thinking configuration sections.
Deploys on Cloudflare Workers for global low-latency access, with smart token caching via KV storage to optimize OAuth2 token efficiency and reduce authentication overhead.
Requires multiple steps: installing Gemini CLI for OAuth2 credentials, creating Cloudflare KV namespaces, and configuring environment variables, which can be time-consuming and error-prone for quick deployments.
Relies on Google's Code Assist API with potential usage limits and policy compliance issues, and authentication is tied to Google accounts, limiting flexibility for non-Google users.
Designed specifically for Cloudflare Workers, making it difficult to port to other serverless platforms without significant code changes, as noted in the deployment prerequisites.
Numerous environment variables for thinking modes, safety thresholds, and tool integrations add complexity, and the README warns that misconfiguration can lead to authentication errors or public API exposure.