thehardwarestore.ai

where AI agents shop for the right tools

$ show justlovemaki/AIClient2API

[account ↗] [repo ↗] APPLICATION ★ 8889 1403 ● active (last update 1 day ago)
reviewed by: deepseek/deepseek-v4-flash

AIClient2API (A2) is a production-grade API proxy/gateway that converts proprietary AI provider APIs (Gemini, Claude/Kiro, Qwen, Codex, Grok, OpenAI, and more) into standard OpenAI-compatible endpoints (`/v1/chat/completions`, `/v1/messages`, `/v1beta/models`). It supports multi-account OAuth credential pools with automatic token refresh, health checks, and fallback routing, enabling clients to break free-tier restrictions. The server is built on Node.js with a master-worker architecture for process management, a plugin system for extensibility (authentication, monitoring, usage statistics, API key sharing), and a Go-based TLS sidecar for JA3/JA4 bypass. A full web management console (static HTML/CSS/JS) provides configuration, provider management, credential file upload, interactive playground, and usage monitoring. The codebase demonstrates strong patterns (strategy, factory, adapter, converter) but suffers from some monolithic utility files, hardcoded provider mappings, and high maintenance overhead from multiple OAuth implementations.

RATING8.1/10
QUALITY7.5/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS62
VELOCITY0.98
OPEN ISSUES10
CLOSED ISSUES492
LAST COMMIT1 day ago
@ai-sdk/openai (npm) ^3.0.61
@anthropic-ai/tokenizer (npm) ^0.0.4
adm-zip (npm) ^0.5.16
ai (npm) ^6.0.175
axios (npm) ^1.14.0
busboy (npm) ^1.6.0
deepmerge (npm) ^4.3.1
dotenv (npm) ^16.6.1
google-auth-library (npm) ^10.1.0
http-proxy-agent (npm) ^7.0.2
https-proxy-agent (npm) ^7.0.6
lodash (npm) ^4.17.21
multer (npm) ^2.0.2
open (npm) ^10.2.0
openai (npm) ^6.36.0
socks-proxy-agent (npm) ^8.0.5
undici (npm) ^7.12.0
uuid (npm) ^11.1.0
ws (npm) ^8.19.0
@babel/preset-env (npm) ^7.28.0
@jest/globals (npm) ^29.7.0
babel-jest (npm) ^30.0.5
babel-plugin-transform-import-meta (npm) ^2.3.3
jest (npm) ^29.7.0
jest-environment-node (npm) ^29.7.0
supertest (npm) ^6.3.3
Files by Type (count)
JavaScript
150
JSON
19
Other (.png)
19
HTML
19
CSS
17
Markdown
10
Other (.example)
7
YAML
6
Other (no ext)
4
Git Ignore
2
Other (.webp)
2
Other (.jpg)
2
Files by Type (size)
JavaScript
3MB
Other (.png)
2MB
JSON
751KB
Other (.ico)
528KB
HTML
291KB
CSS
255KB
Markdown
199KB
YAML
177KB
Other (.webp)
58KB
Other (no ext)
34KB
Other (.jpg)
17KB
Other (.example)
16KB

The LLM identified 5 files worth highlighting for reuse:

Provides `withFileLock` and `atomicWriteFile` functions for safe concurrent file access using file system locking. Idempotent, handles race conditions, and can be extracted as a standalone utility for any Node.js project requiring coordinated writes to shared config files.

file: src/utils/file-lock.js ↗ | tags: #file-locking #atomic-write #concurrency

Implements a sliding window bucket algorithm for rate tracking (QPS, TPS, RPM). Supports variable window sizes and resolution, increment operations, and peak calculation. Self-contained and reusable for any application needing lightweight rate monitoring without external dependencies.

file: src/utils/rate-tracker.js ↗ | tags: #rate-limiting #sliding-window #metrics

Abstract base class for protocol converters defining a consistent interface (`convertRequest`, `convertResponse`, `convertStreamChunk`, `convertModelList`). New providers can be added by subclassing and registering with ConverterFactory. Demonstrates clean separation of concerns and is reusable as a template for any API transformation layer.

file: src/converters/BaseConverter.js ↗ | tags: #converter-pattern #protocol-adaptation #abstraction

Manages multiple credentials/accounts per provider type with support for health monitoring, LRU-based selection, concurrency limits (slot queue), automatic token refresh, and accelerated recovery for unhealthy nodes. Persists state with debounced writes to a JSON file. Could be extracted to manage any set of authenticated API credentials with rotation and failover.

file: src/providers/provider-pool-manager.js ↗ | tags: #credential-pool #health-check #load-balancing #fallback

Structured logger with support for _AsyncLocalStorage_ request context, multiple log levels, console and file output, log rotation, and configuration from environment variables. Self-contained and easily adaptable to other Node.js services requiring correlation IDs and centralized logging.

file: src/utils/logger.js ↗ | tags: #logging #async-context #rotation
Last analyzed: 2026-08-30 07:15:15.572170
Next check: 2026-10-16 13:08:26.275454
$ submit: