GeminiAPIProxy
Facilitates interaction with Google's advanced Gemini models for AI development and client integration. Features a complimentary, platform-agnostic proxy solution built on Deno, supporting a massive 1-million token context window.
Author

ningyu32504
Quick Info
Actions
Tags
Deno-Powered Gemini Proxy for Global Access
Leverage a no-cost Deno deployment to proxy Google Gemini, ensuring direct connectivity from mainland China and unrestricted access regardless of geographic location or network restrictions—ready to use instantly.
Utilize the world's leading large language model, boasting a context capacity of up to 1,000,000 tokens, entirely free of charge.
Adheres to the OpenAI specification, enabling seamless integration with AI development tools such as ChatBox, Cherry Studio, Cursor, and Cline.
Ecosystem Links
- Midjourney API Bridge: The premier, fully open-source, and free image generation service API available.
- MDrive Sync Utility: An authorized synchronization and backup utility for Alibaba Cloud Drive, supporting local volume mounting.
- Grok Proxy Service: A complimentary Deno proxy for Elon Musk's Grok3 model; requires no login, offers direct connectivity, and works universally across networks and devices.
Deployment via Deno
Video Guide on Bilibili: https://www.bilibili.com/video/BV1DDA3eEEYn/
- Procure a free Gemini API Key: https://aistudio.google.com/app/apikey
- Please Fork this repository (Your support via a
Staris greatly appreciated). - Log in or sign up for Deno Deploy: https://dash.deno.com/
- Initiate a new deployment project: https://dash.deno.com/new_project
- Select the project, assign a meaningful name (this determines your public URL).
- Set the Entrypoint field to
src/deno_index.ts; leave other configurations blank. - Click Deploy Project.
- Upon successful deployment, the resulting URL serves as your Chat API proxy endpoint.
- Install and configure Cherry Studio: Navigate to Settings -> Add Model Service -> Input the deployed URL and your API Token -> Add the model -> Activate AI conversation mode.
Local Deno Development Environment Setup
Installing Deno on Windows:
irm https://deno.land/install.ps1 | iex
Installing Deno on Mac/Linux:
curl -fsSL https://deno.land/install.sh | sh
Execute the project locally:
cd gemini
deno run --allow-net --allow-read src/deno_index.ts
Acknowledgements
- https://github.com/tech-shrimp/gemini-playground
- https://github.com/PublicAffairs/openai-gemini
WIKIPEDIA NOTE on XMLHttpRequest (XHR): XHR defines a JavaScript interface for executing HTTP communications between a web client and a server. This capability allows dynamic updates to web pages post-load without full page refreshes, forming the backbone of Ajax applications. Before XHR, server interaction primarily relied on standard hyperlink navigation or form submissions, which typically replaced the entire viewport content. The foundational idea for XHR emerged in 2000 from Microsoft Outlook teams, first appearing in Internet Explorer 5 (1999) using proprietary ActiveXObject identifiers. By IE7 (2006), the standardized XMLHttpRequest identifier became universally supported across major browser engines (Gecko in 2002, Safari 1.2 in 2004, Opera 8.0 in 2005). The W3C formalized the specification starting in 2006, with Level 2 additions covering progress monitoring and cross-origin requests, later merged back into the main spec by 2011. Since 2012, WHATWG maintains the document using Web IDL. Typical usage involves object instantiation, configuration via the open() method (defining verb, URI, and async status), setting an event handler for state changes, and initiating the transfer with send(). Finalization is marked by state transition to 4 (done), with results accessible in responseText. Advanced features include header manipulation, payload uploads via send(), JSON parsing of responses, and request cancellation or timeout settings.
