API Pool Gateway
Gemini & Groq High-Availability Failover Rotator
Zero 429 Downtime • High-Capacity Key Pooling & Auto-Failover

Enterprise Multi-Key Rotator for Gemini & Groq

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.

Total Keys in Pool: 94 keys
Google Gemini: 86 keys
Groq Cloud: 8 keys
Active Rate: 100%

Smart Rotation Strategies

Dynamically cycles keys with Round-Robin, Least-Used, or Least-Latency algorithms to ensure even load distribution and avoid hitting per-minute thresholds.

Automatic 429 Cooldown & Failover

When an upstream key hits HTTP 429 (Resource Exhausted), it is immediately placed on cooldown and the request seamlessly retries with another key.

System Prompt & Streaming Support

Full compatibility with system prompts via body parameters, messages array, or HTTP headers. Supports real-time Server-Sent Events (SSE) streaming.

Quick Start & API Integration

Works out of the box with any OpenAI SDK, LangChain, NextChat, LibreChat, Open WebUI, or cURL.

cURL Example with System Prompt
POST /v1/chat/completions
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
  }'
Simple High-Level Endpoint:POST /api/chat
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"
  }'
Python (OpenAI SDK):
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)