Rust Core

We offer two AI API service solutions to meet different needs:

Product Selection: XAI Router vs XAI Control

📌 Choose the Right Product for Your Use Case

Both products use the same frontend interface but offer completely different service models. Please read the comparison below carefully to select the best solution for you.

🚀 XAI Router - Ready-to-Use AI API Aggregation Service

Portal: m.xairouter.com

Positioning: Alternative to OpenRouter.ai, providing instant AI API aggregation calling service.

Core Features:

  • Pre-paid Model: Use immediately after topping up, no key configuration needed
  • Zero Technical Barrier: Register → Top up → Call, start using in 3 minutes
  • Full Model Coverage: Pre-integrated with OpenAI, Anthropic, DeepSeek, Google, Zhipu, Kimi and other mainstream models
  • Pay-As-You-Go: Only pay for tokens actually used, no monthly fees or minimum spend
  • Developer Friendly: Rich model selection and transparent pricing

Suitable For:

  • 🎯 Rapid development and prototyping
  • 🎯 Personal projects and small applications
  • 🎯 Don't want to manage multiple API keys
  • 🎯 Want to quickly test different models
  • 🎯 Budget-conscious commercial projects

Pricing:

  • Competitive market pricing (usually slightly lower than official)
  • Transparent token billing
  • No hidden fees or service charges

Quick Start:

  1. Visit m.xairouter.com to register
  2. Top up (Alipay/WeChat/Credit Card supported)
  3. Get API Key, start calling immediately

🔑 XAI Control - Dedicated BYOK AI Router

Portal: a.xaicontrol.com (Config Management) / m.xaicontrol.com (Account Management)

Positioning: Your own exclusive, deployment-free, powerful BYOK (Bring Your Own Key) AI routing system.

Core Features:

  • 100% BYOK Architecture: Use your own official API Keys entirely
  • Zero Markup: Direct integration with official APIs, no additional charges
  • Full Control: Key ownership is yours, export or migrate anytime
  • Enterprise Security: End-to-end encryption, no super-admin access
  • Powerful Routing: Load balancing, failover, key rotation, model mapping
  • Multi-tier Accounts: Flexible sub-account management with fine-grained permissions

Suitable For:

  • 🏢 Production environments and enterprise applications
  • 🏢 Large-scale API calls (cost-sensitive)
  • 🏢 Need full control over keys and data
  • 🏢 Multi-team collaboration (sub-account management)
  • 🏢 Need advanced routing and disaster recovery
  • 🏢 Strict compliance requirements (data sovereignty)

Pricing:

  • Basic service free
  • Only pay upstream official API fees
  • No markup or service charges

Technical Capabilities:

  • Like owning an overseas server with a complete XAI Router deployment
  • No complex development or maintenance work
  • Enterprise-grade stability and security

📊 Product Comparison

FeatureXAI RouterXAI Control
Service ModelPre-paid aggregation serviceBYOK routing platform
Key ManagementNo management needed, ready-to-useUse your own official keys
Cost StructurePer-token billingOnly pay official fees
Technical BarrierZero barrier, 3-minute startNeed to apply for official keys
Cost AdvantageMore convenient for small scaleMore economical for large scale
Account SystemBasic account managementMulti-tier fine-grained control
Suitable ScaleSmall to medium projectsEnterprise large-scale usage
Data ControlStandard securityFull autonomous control

🚀 XAI Router Quick Start

Visit m.xairouter.com and complete the following steps:

1. Register Account

  1. Open m.xairouter.com
  2. Click "Register Now", enter email
  3. Verify email (check verification code email)
  4. Set password, complete registration

2. Top Up Account

  1. After logging in, go to "Account Management"
  2. Select top-up amount (recommended first-time: 10-50 USD)
  3. Choose payment method (multiple channels supported)
  4. Complete payment, balance credited immediately

3. Get API Key

  1. Go to "API Keys" page
  2. Click "Create API Key"
  3. Copy your API Key (keep it safe, shown only once)

4. Quick Test

export XAI_API_KEY="your-xai-router-api-key"

# Call OpenAI model
curl https://api.xairouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
      "model": "gpt-4o-mini",
      "messages": [{"role": "user", "content": "Hello, world"}]
    }'

# Call Anthropic model
curl https://api.xairouter.com/v1/messages \
  -H "x-api-key: $XAI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
      "model": "claude-3-7-sonnet-latest",
      "max_tokens": 1024,
      "messages": [{"role": "user", "content": "Hello, world"}]
    }'

5. View Usage and Billing

  • Real-time view of token consumption
  • View cost breakdown by model
  • Export billing reports

🔑 XAI Control Detailed Guide

Below is the complete configuration guide for XAI Control (BYOK mode).

🔑 100% BYOK Architecture - Your Keys, Your Control

XAI Control is a pure BYOK (Bring Your Own Key) platform, fundamentally different from traditional AI aggregation services:

  • Use Your Own API Keys: Add your DeepSeek, OpenAI, Anthropic, etc. official keys to your encrypted space
  • Zero Markup Pricing: Direct integration with official APIs, no additional charges (unlike OpenRouter's 5% fee)
  • Keys Always Belong to You: Export, migrate, or delete your keys anytime with no vendor lock-in
  • End-to-End Encryption: Cryptocurrency-grade encryption with no super-admin access
  • One endpoint, all models: No need to maintain different code for different models. All requests go through a single unified endpoint, api.xaicontrol.com, with the XAI Router intelligently routing to the backend providers.
  • Ready-to-use, fully-featured: You don't need to worry about load balancing, failover, or key rotation. You also gain powerful sub-account management, cost control, and security features.

This document will guide you step-by-step through activating your exclusive BYOK AI router.


1. Register an Account

  1. Open your browser and visit a.xaicontrol.com.
  2. Click "Register Now", enter your email address, and click "Send Verification Code".
  3. Log in to your email and find the email with the subject "Your XAI Verification Code" (Note: The email might be mistakenly marked as spam, so please check your spam folder as well).
  4. Click the "Click to Activate Account" button in the email. You will be redirected back to XAI Control with a success message.
  5. After successful activation, the system will automatically send another email to the same address with the subject "Welcome to XAI - Your Account is Ready!", which contains your exclusive XAI API Key.

2. Add a Provider Key (Core BYOK Step)

💡 This is BYOK (Bring Your Own Key)

You're about to add your own API Keys obtained from official platforms like OpenAI, Anthropic, DeepSeek, etc., not keys purchased from XAI Control.

This means:

  • 🔒 Key ownership is completely yours; XAI Control only acts as a secure routing proxy
  • 💰 All API call charges are deducted directly from your official account with no markup
  • 📊 You can view original usage and billing on the official platform (e.g., OpenAI Dashboard)
  • 🔄 You can replace, delete, or migrate these keys anytime
  1. Log in to a.xaicontrol.com.
  2. Go to "Providers""Add Provider Key".
  3. Fill in the following:
    • Name (Optional): A custom name for easy management.
    • Level: A positive integer for model grouping and categorization.
    • Provider: The API Base URL of the model provider, for example:
      • OpenAI: https://api.openai.com
      • Anthropic: https://api.anthropic.com
      • DeepSeek: https://api.deepseek.com
      • Google Gemini: https://generativelanguage.googleapis.com
    • SecretKey: The API Key from the corresponding provider, typically starting with sk- (or AIzaSy for Google Gemini).
  4. Click "Add Provider Key". The system will encrypt and store this key in your dedicated data space.

3. Quick Test

After completing the steps above, you can use your XAI API Key to call the integrated AI services.

Important Prerequisite

The following examples show how to call OpenAI and Anthropic models respectively. Please ensure that you have added the corresponding Provider Key for the model provider you want to test (e.g., OpenAI, Anthropic) in Step 2. If you have only added the OpenAI key, the Anthropic example will not work.

Calling OpenAI Models

export XAI_API_KEY="Your-XAI-API-Key"

curl https://api.xaicontrol.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
      "model": "gpt-4o-mini",
      "messages": [{"role": "user", "content": "Hello, world"}]
    }'

Calling Anthropic Models

export XAI_API_KEY="Your-XAI-API-Key"

curl https://api.xaicontrol.com/v1/messages \
  -H "x-api-key: $XAI_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "content-type: application/json" \
  -d '{
      "model": "claude-3-7-sonnet-latest",
      "max_tokens": 1024,
      "messages": [{"role": "user", "content": "Hello, world"}]
    }'

4. Sub-Account Management (Fine-Grained Permissions and Quota Control)

XAI Control supports a multi-level sub-account system, making it easy for teams or clients to isolate resources and manage billing independently.

Please note that XAI Control has two management portals:

  1. Configuration Portal: a.xaicontrol.com (Registered users are primary accounts, used for configuring third-party AI Provider Key resources).
  2. Account Management Portal: m.xaicontrol.com (Primary accounts manage sub-accounts and quotas here; sub-accounts view their own usage here).

4.1 Create a Sub-Account

  1. The primary account logs in to m.xaicontrol.com and navigates to the "Create Sub-Account" page.
  2. Fill in:
    • Sub-account username
    • Sub-account email (The system will send the sub-account's XAI API Key to this email)
    • Initial quota
  3. Click "Create Sub-Account"

4.2 Configure Sub-Account Permissions and Quota

Click "Update Sub-Account" to configure fine-grained controls:

SettingDescriptionExample
Quota LimitThe maximum amount (in USD) the sub-account can consume.100.00
Model AllowlistA list of models the sub-account is allowed to call.["gpt-4o-mini", "claude-3-7-sonnet-latest"]
RPM LimitMaximum requests per minute.60
TPM LimitMaximum tokens per minute.100000
IP AllowlistOnly allows calls from specified IPs (leave blank for no restriction).["203.0.113.0/24"]

4.3 Sub-Account Login

Sub-accounts log in to m.xaicontrol.com using their own XAI API Key and can only see:

  • Their own usage and remaining quota.
  • They cannot view or modify the primary account's AI Provider Keys.

5. Why Choose XAI Control?

FeatureDescription
Unified EndpointAll model calls are routed through a single endpoint, api.xaicontrol.com, with the router intelligently routing to the optimal upstream provider.
Key RotationAdd multiple upstream keys. The system monitors key health in real-time, automatically rotating, deactivating, and reactivating them to avoid single-point rate limiting.
FailoverIn case of upstream errors (429/5xx), the system performs millisecond-level circuit breaking, automatic retries, and node switching, all transparent to your application.
Model MappingSupports alias mapping (e.g., gpt-3.5-turbo=gpt-4o-mini), allowing you to upgrade models with zero changes to your existing code.
Seamless CompatibilityNatively compatible with OpenAI/Anthropic APIs. Simply replace the base_url and api_key.
Zero-Trust SecurityEnd-to-end encrypted storage with no super-admin access. Data can only be decrypted by the user's private key, eliminating the risk of data leaks.
Powerful Account ManagementCreate and manage multi-level sub-accounts for your teams or clients. Set granular controls for each account, including custom rates, quotas, rate limits (RPM/TPM), and model access.