Aggregates all your Google Gemini and Groq Cloud API keys into a resilient, load-balanced OpenAI-compatible proxy with smart backoff cooldowns and automatic failover.
Dynamically cycles keys with Round-Robin, Least-Used, or Least-Latency algorithms to ensure even load distribution and avoid hitting per-minute thresholds.
When an upstream key hits HTTP 429 (Resource Exhausted), it is immediately placed on cooldown and the request seamlessly retries with another key.
Full compatibility with system prompts via body parameters, messages array, or HTTP headers. Supports real-time Server-Sent Events (SSE) streaming.
Works out of the box with any OpenAI SDK, LangChain, NextChat, LibreChat, Open WebUI, or cURL.
curl -X POST https://your-domain.vercel.app/v1/chat/completions \
-H "Content-Type: application/json" \
-H "X-System-Prompt: Bạn là trợ lý AI chuyên nghiệp" \
-d '{
"model": "gemini-flash-latest",
"messages": [
{ "role": "user", "content": "Giải thích ngắn gọn cách hoạt động của Key Pool" }
],
"temperature": 0.7,
"stream": false
}'curl -X POST https://your-domain.vercel.app/api/chat \
-H "Content-Type: application/json" \
-d '{
"prompt": "Viết 1 đoạn thơ ngắn về công nghệ",
"system": "Bạn là nhà thơ hiện đại",
"provider": "gemini",
"model": "gemini-flash-latest"
}'from openai import OpenAI
client = OpenAI(
base_url="https://your-domain.vercel.app/v1",
api_key="none" # Not needed unless CLIENT_API_KEY is configured
)
response = client.chat.completions.create(
model="gemini-flash-latest", # or "llama-3.3-70b-versatile"
messages=[
{"role": "system", "content": "Bạn là chuyên gia lập trình Next.js và Python."},
{"role": "user", "content": "Tạo một hàm xoay round-robin trong Python"}
],
temperature=0.7
)
print(response.choices[0].message.content)