Route your AI coding tool's API calls through a free Gemini account instead of paying for OpenAI or Anthropic API access.
Run a local server that load-balances across multiple Google accounts, automatically rotating credentials when one runs low on quota.
Use Gemini image generation models through a standard API endpoint with custom resolution and aspect ratio parameters.
Deploy a multi-instance setup with MongoDB for teams sharing Gemini quota across multiple users.
Requires a Google account and completing an OAuth login through Gemini CLI before the server can make requests.
gcli2api is a Python tool that turns Google's Gemini CLI tool and a service called Antigravity into API servers that other software can talk to. It translates between the formats those tools use internally and the standard API formats used by OpenAI, Gemini, and Claude, so existing apps and coding tools that already know how to talk to those APIs can route their requests through Gemini without any changes to the calling software. The README is written primarily in Chinese. The core idea is credential bridging. Instead of paying for Gemini API keys directly, users can log in through Google's OAuth flow and have gcli2api manage those login credentials. The server rotates through multiple saved credentials automatically, spreads load across them, detects when one stops working, and disables it. Each credential provides a quota of requests. A web dashboard lets you upload, enable, disable, and monitor credentials through a browser. The server exposes several API endpoints depending on which format the calling software expects: an OpenAI-compatible chat endpoint, a native Gemini endpoint, and a Claude-format endpoint. It handles streaming responses, multi-turn conversation context, and thinking-mode models that separate reasoning steps from final answers. Installation is available for Windows, Linux, macOS, Termux (Android terminal), and Docker. The Docker path is the simplest for most users: one command starts the server with a password and a mounted credential folder. The default storage is a local SQLite database, with an optional MongoDB mode for deployments running multiple instances. The project supports Gemini 2.5 Pro and related models, plus image generation models through Antigravity. Model names can include suffixes to control resolution and aspect ratio for image outputs.
← su-kaka on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.