Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Gemini CLI
  3. geminicli2api

geminicli2api

MITPython

A FastAPI proxy that transforms Google's Gemini CLI into OpenAI-compatible and native Gemini API endpoints for easy integration.

GitHubGitHub
588 stars631 forks0 contributors

What is geminicli2api?

Gemini CLI to API Proxy is a FastAPI-based server that converts Google's Gemini CLI tool into standard API endpoints. It provides both OpenAI-compatible and native Gemini API interfaces, allowing developers to integrate Gemini's AI capabilities into applications using familiar API patterns. The proxy enables access to Google's free Gemini API quota through a standardized interface.

Target Audience

Developers and teams building AI-powered applications who want to use Google's Gemini models through API interfaces compatible with OpenAI's format or direct Gemini API calls.

Value Proposition

It provides a drop-in replacement for OpenAI's API while leveraging Google's free Gemini quota, offers both streaming and multimodal support, and is containerized for easy self-hosting. The proxy eliminates the need to adapt tools specifically for Gemini's CLI, enabling broader integration.

Overview

Gemini CLI to API Proxy is a FastAPI-based server that converts the Gemini CLI tool into standard API endpoints. It enables developers to use Google's free Gemini API quota through familiar OpenAI API interfaces or direct Gemini API calls, making it simple to integrate Gemini capabilities into existing applications.

Key Features

  • OpenAI-Compatible API — Drop-in replacement for OpenAI's chat completions API, allowing seamless integration with tools expecting OpenAI's format.
  • Native Gemini API — Direct proxy to Google's Gemini API, supporting all its endpoints and features.
  • Streaming Support — Real-time streaming responses for both API formats, enabling interactive applications.
  • Multimodal Support — Handles text and image inputs, leveraging Gemini's multimodal capabilities.
  • Authentication Flexibility — Supports multiple auth methods including Bearer tokens, Basic auth, query parameters, and Google API headers.
  • Model Variants — Automatically creates model variants with Google Search grounding and thinking/reasoning controls.
  • Docker Ready — Containerized for easy deployment and includes Hugging Face Spaces compatibility.

Philosophy

The project aims to bridge the gap between Google's Gemini CLI and the broader ecosystem of AI tools by providing a standardized, easy-to-deploy API layer that maintains compatibility with popular interfaces.

Use Cases

Best For

  • Integrating Gemini models into applications that expect OpenAI's API format
  • Self-hosting a proxy to use Google's free Gemini API quota
  • Adding streaming AI responses to applications using Gemini models
  • Building multimodal applications with text and image inputs via API
  • Deploying an AI API proxy on Hugging Face Spaces or Docker containers
  • Creating a unified API layer for tools that work with both OpenAI and Gemini models

Not Ideal For

  • Production systems needing high-throughput, low-latency AI inference without proxy overhead
  • Teams using multiple AI providers beyond Google's Gemini models
  • Applications requiring advanced API management features like built-in rate limiting or detailed analytics

Pros & Cons

Pros

OpenAI API Compatibility

Acts as a drop-in replacement for OpenAI's chat completions API, enabling seamless integration with existing tools and libraries, as shown in the Python example using the openai client.

Native Gemini Feature Access

Proxies all Gemini API endpoints, allowing use of advanced features like thinking controls and Google Search grounding through model variants like '-search' and '-maxthinking'.

Streaming and Multimodal Support

Supports real-time streaming responses and handles text and image inputs, leveraging Gemini's capabilities for interactive and vision-based applications.

Flexible Deployment Options

Containerized with Docker and configured for Hugging Face Spaces, simplifying setup and scaling across different hosting environments.

Cons

Complex Credential Setup

Requires managing Google OAuth credentials or API keys, which adds initial configuration overhead compared to simpler authentication methods and can be error-prone.

Vendor Lock-in to Google

Tied exclusively to Google's Gemini models, limiting flexibility if you need to switch to or incorporate other AI providers like OpenAI or Anthropic.

Performance Overhead

Adds an extra network hop as a proxy layer, which can increase latency and become a bottleneck in high-demand scenarios without built-in clustering or load balancing.

Frequently Asked Questions

Quick Stats

Stars588
Forks631
Contributors0
Open Issues10
Last commit6 months ago
CreatedSince 2025

Tags

#fastapi#llm-integration#streaming-api#ai-tools#self-hosted-ai#openai-compatible#docker#multimodal-ai#gemini-api#api-proxy

Built With

F
FastAPI
P
Python
D
Docker

Included in

Gemini CLI387
Auto-fetched 11 hours ago

Related Projects

gemini-cli-openaigemini-cli-openai

Expose Gemini CLI endpoints as OpenAI API with Cloudflare Workers

Stars886
Forks213
Last commit12 days ago
Gemini CLI TermuxGemini CLI Termux

Gemini-CLI-Termux is an automated deployment tool designed specifically for the Android Termux environment. It enables users to easily run a reverse proxy service for Google's Gemini AI models on their mobile devices, providing OpenAI-compatible API endpoints. This makes advanced AI capabilities accessible directly from a smartphone, turning it into a local API server. ## Key Features - **One-Click Deployment** — Single command installs and configures the entire service with an interactive menu. - **OpenAI-Compatible API** — Provides `/v1/chat/completions` and `/v1/models` endpoints for seamless integration with existing tools. - **Full Gemini Model Support** — Supports Gemini 3.1 Pro, 3 Pro, 3 Flash, 2.5 Pro, and 2.5 Flash series, including search-enhanced and thinking variants. - **Multiple Authentication Methods** — Includes HTTP Basic Auth, Bearer Token, API Key query parameter, and Google API Key header support. - **LAN Accessibility** — Configurable to allow network listening, enabling other devices on the same network to use the API. - **Interactive Management Menu** — Visual interface for service control, configuration changes, and system maintenance without command-line expertise. ## Philosophy The project prioritizes mobile-first, zero-friction deployment, bringing powerful AI API hosting to Android devices through a simplified, menu-driven experience.

Stars172
Forks23
Last commit3 months ago
gemini-cli-proxygemini-cli-proxy

Wrap Gemini CLI as an OpenAI-compatible API service, allowing you to enjoy the free Gemini Pro model through API!

Stars148
Forks26
Last commit2 months ago
gemini-cli-mcp-openai-bridgegemini-cli-mcp-openai-bridge

Gemini CLI Bridge is a server application built on top of Google's Gemini CLI. It exposes Gemini CLI's native tools via the Model Context Protocol (MCP) and provides a fully compatible OpenAI API endpoint, enabling seamless integration with third-party applications like Open WebUI. ## Key Features - **MCP Toolkit** — Exposes Gemini CLI's built-in tools (file operations, web search, content understanding) through a unified MCP endpoint. - **OpenAI API Bridge** — Provides `/v1/chat/completions` and `/v1/models` endpoints compatible with OpenAI's API, allowing any OpenAI-supporting tool to use Gemini models. - **External MCP Aggregation** — Acts as an MCP hub to connect and proxy tools from external MCP servers (in configured or YOLO modes). - **Flexible Security Policies** — Implements configurable security modes (read-only, edit, configured, yolo) to control tool execution and file operation scope. - **Inherited Authentication** — Uses the same authentication and configuration as the main Gemini CLI tool, requiring no duplicate setup. ## Philosophy The project prioritizes security and extensibility, providing a bridge that unlocks Gemini CLI's capabilities for the broader ecosystem while maintaining granular control over tool access and execution risks.

Stars137
Forks30
Last commit11 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub