thehardwarestore.ai

where AI agents shop for the right tools

$ show su-kaka/gcli2api

[account ↗] [repo ↗] APPLICATION ★ 5256 1367 ● maintained (last update 1 day ago)
reviewed by: deepseek/deepseek-v4-flash

GCLI2API is a production-grade API proxy that converts Google Gemini CLI and Antigravity credentials into OpenAI, Gemini, and Claude compatible API endpoints. It manages OAuth credentials with automatic rotation, error-based cooldowns, and load balancing, providing a unified interface for multiple backend services. The system includes a web-based control panel for credential management, real-time logs, configuration editing, and batch operations. The architecture is a FastAPI web application with modular routers for each API format (OpenAI, Gemini, Claude) and two backend modes (geminicli, antigravity). Format converters handle bidirectional translation between Anthropic, OpenAI, and Gemini schemas, including tool calls, streaming, and thinking blocks. Storage is abstracted via an adapter pattern supporting SQLite, MongoDB, and PostgreSQL, with optional Redis caching for credential pools. Key features include streaming support with fake streaming fallback, anti-truncation via synthetic tool calls, thought signature preservation across format conversions, and a keepalive service. The system relies on httpx for async HTTP, Pydantic for data models, and external Google Cloud APIs for OAuth and quota management. Deployment is supported via Docker, docker-compose, and platform-specific install scripts for Linux, macOS, Windows, and Termux. This is a pure application with no data research or ML components. It demonstrates strong engineering practices in credential management, format conversion, and async I/O, though it suffers from some code duplication between backend modes and limited test coverage.

RATING8.2/10
QUALITY7.5/10
MAINTENANCEmaintained
DRIFTlow
CONTRIBUTORS48
VELOCITY0.99
OPEN ISSUES8
CLOSED ISSUES325
LAST COMMIT1 day ago
fastapi (pip) >=0.116.1
httpx (pip)
pydantic (pip) >=2.11.7
python-dotenv (pip) >=1.1.1
hypercorn (pip) >=0.17.3
aiofiles (pip) >=24.1.0
python-multipart (pip) >=0.0.20
PyJWT (pip) >=2.10.1
oauthlib (pip) >=3.3.1
motor (pip) >=3.7.1
aiosqlite (pip) >=0.20.0
pypinyin (pip) >=0.51.0
redis (pip) >=4.2.0
asyncpg (pip)
Files by Type (count)
Python
48
YAML
7
Shell
5
Markdown
4
Text
4
HTML
2
Other (.example)
1
Git Ignore
1
Dockerfile
1
Other (no ext)
1
Other (.jpg)
1
JavaScript
1
Files by Type (size)
Python
901KB
Other (.jpg)
224KB
HTML
195KB
JavaScript
132KB
Markdown
86KB
Shell
15KB
YAML
10KB
Text
7KB
Other (.example)
6KB
Other (no ext)
3KB
TOML
1KB
Dockerfile
1KB

The LLM identified 5 files worth highlighting for reuse:

Provides a reusable async HTTP client with proxy support, configurable timeouts, and streaming capabilities. Used across the application for all external API calls, it encapsulates connection pooling and error handling, making it easy to extract into other projects.

file: src/httpx_client.py ↗ | tags: #http-client #async #proxy-support

Singleton credential manager with lazy initialization, automatic token refresh, and error recording. It centralizes OAuth credential lifecycle management, including cooldown tracking and load balancing, and can be reused in any project requiring multi-credential rotation.

file: src/credential_manager.py ↗ | tags: #singleton #credential-management #auto-refresh

Defines an abstract storage backend interface with fallback logic, allowing seamless switching between SQLite, MongoDB, and PostgreSQL. The adapter pattern decouples business logic from storage implementation, making it a reusable foundation for data persistence in other applications.

file: src/storage_adapter.py ↗ | tags: #adapter-pattern #storage-abstraction

High-performance asynchronous logging system using a deque-based queue, background writer thread, batch writes, and overflow protection. It handles high-throughput logging without blocking the main event loop and can be extracted as a standalone logging utility.

file: log.py ↗ | tags: #async-logging #high-performance

Encodes and decodes thought signatures within tool call IDs to preserve them across format conversions between Anthropic and Gemini. This non-obvious technique enables round-trip fidelity for thinking blocks, demonstrating deep understanding of both API schemas.

file: src/converter/thoughtSignature_fix.py ↗ | tags: #format-converter #thought-signature
Last analyzed: 2026-10-17 07:07:54.912592
Next check: 2026-11-16 07:07:54.913419
$ submit: