Configs2026年9月12日·1 分钟阅读

AIClient2API — Self-Hosted Multi-Protocol AI API Gateway

Unified proxy that converts between OpenAI, Claude, and Gemini API protocols with smart routing, provider pools, and automatic failover.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 29/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
CLI Tool
安装
Single
信任
信任等级:Established
入口
AIClient2API Overview
安全暂存命令
npx -y tokrepo@latest install 9b29324e-aecd-11f1-9bc6-00163e2b0d79 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

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.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产