Gemini-CLI-2-API is an open source project , its core function is to Google's Gemini CLI tool encapsulated with the OpenAI API-compatible native API services. Specifically includes the following features:
- Provides a standard OpenAI-compatible interface that supports /v1/models and /v1/chat/completions endpoints.
- Automatic conversion of OpenAI-formatted requests and responses to Gemini format
- Provides AI capabilities based on Gemini 2.5 Pro model, supports 1000 free requests per day
- Streaming response support for real-time display of results like a typewriter
- Provide a detailed logging system, including request prompt words, time stamps and other information
- Supports multiple authentication methods such as Bearer tokens, URL query parameters and x-goog-api-key
The tool is especially suited for developers who need to deploy AI services locally or call Gemini models with high frequency, seamlessly accessing the existing OpenAI toolchain without code changes.
This answer comes from the articleGemini-CLI-2-API: Converting the Gemini CLI to an OpenAI-compatible Native API ServiceThe