gcli2api puts a rotated pool of Antigravity OAuth credentials behind an OpenAI shaped endpoint
Converts GeminiCLI and Antigravity into OpenAI, Gemini and Claude API-compatible interfaces.
At a glance
- What is it?
- A FastAPI service that republishes Antigravity credentials as OpenAI, Gemini and Claude format endpoints, with credential rotation, model name suffixes and a browser based OAuth panel. Useful for a shared internal endpoint, awkward for anyone who just wants a key to put in a config file.
- Who is it for?
- Adopt gcli2api if you want one internal base URL that speaks all three formats and you can live with a browser OAuth flow and a pool of OAuth credentials. Do not adopt it if your requirement is a key you can paste into a third party tool.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 3 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- su-kaka/gcli2api5,360 ★ · +187
| Repository | 2026-09-15 | 2026-11-15 |
|---|---|---|
| su-kaka/gcli2api | 5.2k | 5.4k |
187 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
Every request is billed against a rotated OAuth credential pool
The unit of capacity is a credential file, not a key in your config. The pool rotates multiple Google OAuth credentials with random load balancing, a 429 puts the matching model family on cooldown, and with AUTO_BAN enabled a credential that hits one of AUTO_BAN_ERROR_CODES (default 403) is disabled automatically. The panel adds batch enable, disable and delete over the credential directory, plus a quota view per file. That design is the reason a second file raises your ceiling instead of raising your rate limit.
The consequence is that your throughput is a function of how many credential files you are willing to upload. Exhaust the pool and there is no request left to serve; the documentation describes the disabling mechanism and the configurable 429 retry interval and count.
Model names double as a command line
Request parameters are encoded in the model string. Prefixing `抗截断-` (for example `抗截断-gemini-2.5-pro`) switches on synthetic tool calls that are meant to stop answers being cut off in both streaming and non streaming mode. Image generation models take resolution suffixes (`-2k`, `-4k`) and ratio suffixes (`-16x9`, `-9x16` and others).
The model list is fetched dynamically from the Antigravity API, and MODEL_REWRITE_RULES can map an incoming name such as `gpt-4o` to another model such as `gemini-2.5-pro`. Pin exact names in client configuration rather than assembling them.
Authentication happens in a browser, there is no key path
You onboard by opening `http://127.0.0.1:7861` and completing the Antigravity OAuth flow (default password `pwd`). After that, your client sends a password, not a credential: the OpenAI shape takes base URL `http://127.0.0.1:7861/v1` with API key `pwd`, and the Gemini shape accepts `Authorization: Bearer`, the `x-goog-api-key` header, or a `?key=` query parameter. The panel itself uses JWT tokens.
Credentials can also be uploaded as JSON or ZIP files, or imported as JSON with only `refresh_token` required, so a headless box can take credentials obtained elsewhere, but its panel still has to be reachable. And the shipped default is a shared `pwd`: `API_PASSWORD` and `PANEL_PASSWORD` can separate the API from the panel, but leaving them unset publishes a guessable credential on whatever interface you bind.
Five install scripts pull from master, and no release is tagged
There is no versioned download. Every installer is fetched from the master branch at install time, so two people running the same command on different days get different trees. On Linux and macOS the pattern is the same one line curl into a shell script, then a restart from inside the cloned directory; Windows runs `install.ps1` through `iex`, and Termux has its own pair, `termux-install.sh` and `termux-start.sh`.
curl -o install.sh "https://raw.githubusercontent.com/su-kaka/agy2api/refs/heads/master/install.sh" && chmod +x install.sh && ./install.shcd agy2api
bash start.shpyproject.toml says version `0.1.0` and there are no tagged releases, so nothing pins the code you just ran. The Docker route uses `ghcr.io/su-kaka/agy2api:latest`, a moving `latest` tag.
Two container recipes disagree about which ports matter
The docker run command uses `--network host` with `API_PASSWORD`, `PANEL_PASSWORD` and `PORT=7861` set, so nothing is published through Docker and the container shares the host stack. The checked in compose file also uses `network_mode: host` and publishes no ports, and the image declares only `EXPOSE 7861`.
docker run -d --name agy2api --network host -e API_PASSWORD=api_pwd -e PANEL_PASSWORD=panel_pwd -e PORT=7861 -v $(pwd)/data/creds:/app/creds -v $(pwd)/data/request_logs:/app/data/request_logs ghcr.io/su-kaka/agy2api:latestDependency floors disagree between the two manifests
pyproject.toml and requirements.txt are not the same list. The package metadata requires `asyncpg>=0.31.0`, while requirements.txt, which is what the Dockerfile installs, asks for a bare `asyncpg` with no lower bound. The dev extras such as pytest, black and mypy exist only in pyproject.toml, so a fresh container has no test runner in it. The floor is `requires-python >=3.12` while the classifiers name 3 and 3.13, and the image builds on `python:3.13-slim`.
Two paths, two resolutions. If you install from source with pip you get the stricter floors; if you run the published image you get what requirements.txt pins, and the two can drift apart on any release where one file changes and the other does not.
CNC-1.0 plus storage backends with no setup steps
The default store is a local SQLite database created on first run, which suits one box and nothing else. The dependency list carries aiosqlite for SQLite and asyncpg for PostgreSQL, which is enabled by setting `POSTGRESQL_URI` (commented out in the compose file) for multi-instance deployments. An optional `REDIS_URL` stores cache-mode session bindings so several instances can share them; without it they live in process memory.
Licensing needs reading too. pyproject.toml declares `license = {text = "CNC-1.0"}` and classifies the project as Other/Proprietary License, and a LICENSE file sits at the top of the tree. For anything commercial, open the LICENSE file and check the terms yourself before you deploy; do not infer permission from the fact that the source is public.
Editorial conclusion
Adopt gcli2api if you want one internal base URL that speaks all three formats and you can live with a browser OAuth flow and a pool of OAuth credentials. Do not adopt it if your requirement is a key you can paste into a third party tool. Check the LICENSE file, since pyproject.toml declares `CNC-1.0` and the Other/Proprietary classifier, before any deployment that touches company data, and count how many credential files you can realistically add, because that count is your ceiling.
Frequently asked questions
Does gcli2api accept a Gemini API key, and is it the same as a general Google API key?
The project accepts a key on its Gemini native endpoints in three shapes, listed as Authorization Bearer, the x-goog-api-key header, and a ?key= query parameter. Behind those endpoints there is no key of yours in play at all: capacity comes from a rotated pool of Google OAuth credentials.
Is an API key free for gcli2api, or what does access cost?
The documentation sets no price for an API key because it never asks you for one during onboarding. You complete an OAuth flow, then authenticate to the proxy itself with the password in API_PASSWORD (default `pwd`), while PANEL_PASSWORD protects the control panel.
Can gcli2api be provisioned on a headless server with no browser?
Partly. The Antigravity OAuth flow is completed in the panel at http://127.0.0.1:7861, but credentials can also be uploaded as JSON or ZIP files or imported as JSON with only refresh_token required, so a headless host still needs its panel port reachable to add them.
How much traffic can gcli2api serve before it runs out?
The pool spreads requests across multiple Google OAuth credentials (CREDENTIAL_SELECT_MODE chooses random, cache or sticky selection), a 429 sets a cooldown for the matching model family, and AUTO_BAN can disable a credential on configured error codes (default 403), so the number of credentials is the ceiling you control.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/su-kaka-gcli2api)Star history chart for your README
[](https://hysenlabs.com/projects/su-kaka-gcli2api)Was this useful?