# AiGate Comprehensive LLM & Knowledge Specification > Full machine-readable technical overview of AiGate AI API Gateway, SmartRoute 2.0 Engine, and Infrastructure Services. ## 1. Product Summary AiGate (operated by Luyun (Shanghai) Information Technology Co., Ltd. / 卢云(上海)信息科技有限公司) is an enterprise-grade AI API gateway and multi-tenant management system. It decouples application development from model providers, allowing teams to call OpenAI, Anthropic, DeepSeek, Google Gemini, and open-source models through a single API interface. ## 2. Key Architecture & Components ### 2.1 Unified API Gateway - **Base Endpoint**: `https://api.aigatea.com/v1` - **Supported Paradigms**: - `/v1/chat/completions` (Chat completions, tool calls, structured outputs) - `/v1/embeddings` (Text embeddings) - `/v1/realtime` (Realtime voice & bidirectional audio) - Multimodal Vision / Image processing ### 2.2 SmartRoute 2.0 Engine SmartRoute 2.0 evaluates upstream channels dynamically before forwarding requests. Scoring parameters include: - Channel Health & Active SLA Status - Historical Success Rate & 95th Percentile Latency - Upstream Cost vs. Customer Group Pricing - Target Gross Profit Margin Snapshot - Remaining Quotas & Concurrent Load If an upstream provider experiences rate-limiting (429), server errors (5xx), or timeout, SmartRoute automatically fails over to alternative healthy channels within milliseconds according to configured fallback policies. ### 2.3 Token Billing & Financial Isolation - **Pre-allocation**: Estimates request cost upper bound and holds credit reserve before forwarding. - **Settlement**: Calculates actual prompt tokens, cached prompt tokens, and completion tokens upon response. - **Snapshot Audit**: Records fixed pricing and cost snapshot on a per-request basis to guarantee non-repudiable audit logs for billing reconciliation. ### 2.4 Security & Access Controls - **API Key Scopes**: Restrict keys by model IDs, allowed API endpoints, client IP/CIDR subnets, and expiration dates. - **Rate Limits**: Configurable Requests Per Minute (RPM), Tokens Per Minute (TPM), and Max Concurrent Connections per key. - **Key Rotation**: Seamless key rotation without invalidating historical transaction records. ## 3. Deployment & Commercial Operations For enterprises or providers wishing to operate their own branded AI aggregation platform: - **AiGate Deploy (`/deploy/`)**: Delivers turnkey platform installation including independent branding, domain setup, payment integration, reseller channel management, monitoring dashboard, and production HA deployment. ## 4. Code Integration Examples ### Python (OpenAI SDK) ```python from openai import OpenAI client = OpenAI( base_url="https://api.aigatea.com/v1", api_key="YOUR_AIGATE_API_KEY" ) response = client.chat.completions.create( model="deepseek-r1", # or "claude-3-5-sonnet", "gpt-4o" messages=[{"role": "user", "content": "Explain AI GEO in 2 sentences."}] ) print(response.choices[0].message.content) ``` ### Node.js (OpenAI SDK) ```javascript import OpenAI from "openai"; const openai = new OpenAI({ baseURL: "https://api.aigatea.com/v1", apiKey: process.env.AIGATE_API_KEY, }); async function main() { const completion = await openai.chat.completions.create({ messages: [{ role: "user", content: "Hello AiGate" }], model: "claude-3-5-sonnet", }); console.log(completion.choices[0].message.content); } main(); ``` ### cURL ```bash curl https://api.aigatea.com/v1/chat/completions \ -H "Authorization: Bearer $AIGATE_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gpt-4o", "messages": [{"role": "user", "content": "Hello AiGate"}] }' ``` ## 5. Frequently Asked Questions (FAQ) ### What models are supported by AiGate? AiGate supports all major LLMs including OpenAI GPT-4o / o3-mini, Anthropic Claude 3.5 Sonnet, DeepSeek V3 / R1, Google Gemini 1.5, Qwen 2.5, and Llama 3.3. ### Is AiGate compatible with OpenAI SDKs? Yes. You only need to update your `base_url` to `https://api.aigatea.com/v1` and supply your AiGate API key. ### Does AiGate support private enterprise deployment? Yes. AiGate provides self-hosted deployment packages for enterprise networks or custom AI API SaaS businesses via `https://aigatea.com/deploy/`. ## 6. Official Navigation & Resources - Website Root: https://aigatea.com/ - English Home: https://aigatea.com/en/ - Deployment Services: https://aigatea.com/deploy/ - Documentation: https://api.aigatea.com/docs - Register Account: https://api.aigatea.com/register