pi-gemini-app
In-process Google Gemini App provider extension for Pi (direct native HTTP/2, /login gemini-app, /gemini-quota, zero runtime dependencies).
Package details
Install pi-gemini-app from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-gemini-app- Package
pi-gemini-app- Version
0.1.13- Published
- Nov 24, 2026
- Downloads
- 2,411/mo · 2,411/wk
- Author
- shawtim
- License
- MIT
- Types
- extension
- Size
- 430.2 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"image": "https://raw.githubusercontent.com/ShawTim/gemini-app2api/main/docs/assets/pi-extension.jpg",
"extensions": [
"./extensions/pi/index.js"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-gemini-app — Google Gemini App Provider for Pi

Native in-process provider extension for @earendil-works/pi-coding-agent (pi) and GooeyPi. Connects directly to Gemini's native HTTP/2 endpoint (ProcessQuery) inside the Pi process—no separate HTTP gateway server, Docker container, or extra npm runtime dependencies required.
Disclaimer: Unofficial interoperability software. Not affiliated with, endorsed by, or sponsored by Google. You must authenticate personally with your own eligible Google account.
Installation
Option 1: Install from npm / Pi Marketplace (Recommended)
pi install npm:pi-gemini-app
Option 2: Install directly from Git
pi install git:github.com/ShawTim/gemini-app2api
Option 3: Load from a local clone
git clone https://github.com/ShawTim/gemini-app2api.git
cd gemini-app2api
pi -e ./extensions/pi
Or add the extension path to your Pi settings (~/.pi/agent/settings.json):
{
"extensions": ["/path/to/gemini-app2api/extensions/pi"]
}
Architecture & When to Choose pi-gemini-app vs gemini-app2api
- In-Process Direct HTTP/2 (
pi-gemini-app): Runs completely inside Pi / GooeyPi using Node.js built-ins (node:http2,node:crypto). Ideal for single-user Pi / GooeyPi terminal sessions with zero background daemons or Docker containers. - Full Standalone Gateway (
gemini-app2api): Use the main repository if you need multi-account quota pooling/failover, OpenAI-compatible/v1/chat/completions&/v1/responsesendpoints for Cursor/Cline/Codex CLI, or the/adminweb operations console.
Authentication (/login gemini-app)
Credentials are stored and refreshed exclusively through Pi's built-in CredentialStore (auth.json with file locking).
Run inside Pi:
/login gemini-app
Terms of Service Notice: Completing
/login gemini-appexchanges a scoped Gemini credential and automatically submits acceptance of the Google Gemini Terms of Service on behalf of the signed-in Google account so native HTTP/2 turns work immediately without an extra prompt (transientTOS_*check errors are deferred non-fatally). Sign in only with an eligible account whose Terms of Service you intend to accept.
The login flow supports both local desktop and headless SSH environments simultaneously:
- Desktop / Local Browser: Opens (or prints) the Google OAuth consent URL and listens on a random ephemeral loopback port (
127.0.0.1:0). Completing sign-in in the browser finishes automatically. - Headless / SSH: Open the printed authorization URL in a browser on another machine. After approving sign-in, copy the final
http://localhost:...redirect URL from your browser's address bar and paste it into Pi's prompt.
Optional environment overrides if using your own OAuth desktop client:
GEMINI_OAUTH_CLIENT_IDGEMINI_OAUTH_CLIENT_SECRET
Models
| Model ID | Display Name | Context Window | Max Output | Capabilities |
|---|---|---|---|---|
gemini-neon |
Gemini Neon | 512,000 | 16,384 | Text, static images (PNG/JPEG/WebP), tools, thinking (minimal–xhigh); gemini-argon temporarily aliases here |
gemini-hydrogen |
Gemini Hydrogen | 512,000 | 16,384 | Text, static images (PNG/JPEG/WebP), tools, thinking (minimal–xhigh) |
gemini-flash-lite |
Gemini Flash Lite | 128,000 | 8,192 | Text, static images (PNG/JPEG/WebP), tools, thinking (minimal–xhigh) |
gemini-auto |
Gemini Auto | 128,000 | 8,192 | Smart Model Selection for Free & paid Google accounts (text, static images, tools) |
Subscription Tier Detection:
/login gemini-appautomatically detects your account's Google AI subscription tier viaGetUsageInfo. Free accounts automatically filter available models togemini-auto(avoiding paid-mode precondition rejections), while AI Plus, AI Pro, and AI Ultra accounts expose all models. Run/gemini-quotaat any time to check both your detected tier and rolling usage windows.Quota Tip: On
thinking=2coding and tool-call loops,gemini-neonuses only~1.5x–2xthe rolling-window quota ofgemini-hydrogen(and~4x–5xonthinking=0generation), so you can daily-drivegemini-neoncomfortably or switch togemini-hydrogenwhen you want~1.7x–2.6xfaster responses and extra quota headroom.Usage Accounting: Token counters reported in Pi are local character-based estimates over message text (
~3.5chars/token, excluding image payloads and tool schemas) rather than official Google token counts.Auto-Compaction: The configured
contextWindow(512,000for Neon/Hydrogen;128,000for Flash Lite/Auto) works automatically with Pi's proactive compaction (contextWindow - reserveTokens) and413context-overflow recovery compaction (or manual/compact).
Commands
/gemini-quota— Fetches and displays your signed-in account's detected subscription tier, rolling usage percentages, and reset timestamps.
Security & Privacy
- Zero runtime dependencies: Ships only pure ESM modules using built-in Node.js APIs;
@earendil-works/pi-aiand@earendil-works/pi-coding-agentare provided by the Pi host viapeerDependencies. - No shell or daemon spawning: Contains zero
child_processinvocations and never starts background services. - Host-managed credentials: OAuth refresh and scoped access tokens live exclusively in Pi's
CredentialStore(auth.json). - Automatic Terms of Service submission: Completing
/login gemini-appautomatically submits Google Gemini Terms of Service acceptance for that signed-in account.