Introduction
AIClient2API is a self-hosted AI API gateway that unifies access to multiple LLM providers through protocol conversion. It accepts requests in OpenAI, Claude, or Gemini API formats and routes them to any configured backend, handling protocol translation transparently. This lets you switch providers or use multiple providers behind a single API endpoint.
What AIClient2API Does
- Converts between OpenAI, Claude, and Gemini API protocols bidirectionally
- Routes requests across multiple provider backends with load balancing
- Handles automatic failover when a provider is unavailable
- Pools API keys across providers for rate limit management
- Exposes a single unified endpoint for all configured models
Architecture Overview
AIClient2API is a Node.js application that acts as a reverse proxy between your applications and LLM providers. Incoming requests are parsed according to their protocol format, transformed into the target provider's format, forwarded, and the response is converted back. A routing layer supports round-robin, priority-based, and cost-optimized strategies across provider pools.
Self-Hosting & Configuration
- Install Node.js dependencies and configure provider API keys in .env
- Define provider pools and routing rules in the configuration file
- Set the listening port and optional authentication for the gateway endpoint
- Deploy with Docker or run directly via npm start
- Monitor request logs and provider health through the built-in dashboard
Key Features
- Bidirectional protocol conversion between major LLM API formats
- Provider pool management with automatic failover and health checks
- Smart routing based on cost, latency, or custom rules
- API key pooling for distributed rate limit management
- Self-hosted with no external dependencies beyond the configured providers
Comparison with Similar Tools
- LiteLLM — Python-based proxy with similar goals; AIClient2API is Node.js with emphasis on protocol conversion
- OpenRouter — cloud-hosted unified API; AIClient2API is fully self-hosted
- Portkey AI Gateway — enterprise-focused with cloud features; AIClient2API is simpler and local-first
- Kong/APISIX — general API gateways without LLM-specific protocol translation
- Cloudflare AI Gateway — edge-based proxy without self-hosting option
FAQ
Q: Which LLM providers are supported? A: OpenAI, Anthropic Claude, Google Gemini, Grok, and any OpenAI-compatible API endpoint.
Q: Does it modify the model responses? A: No, it only handles protocol format conversion. Model responses are passed through without modification.
Q: Can I use it to load balance across multiple API keys? A: Yes, the provider pool feature distributes requests across multiple keys with configurable routing strategies.
Q: Is there a rate limiting feature? A: The gateway handles upstream rate limits via automatic failover and retry logic. You can also configure request rate limits on the gateway itself.