Admin Console

XAI Admin is a graphical configuration management console for owners, used to manage provider keys, system configuration, news broadcasts, and operation logs.


Feature Overview

The XAI Admin console includes the following core functional modules:

  1. AI API Documentation - View supported AI service providers and SDK examples
  2. Model Services (Provider Management) - Manage upstream AI provider keys
  3. System Configuration - Configure model mapping, level mapping, resource allowlists, etc.
  4. Broadcast Notifications - Publish system-level or targeted user notifications
  5. Operation Logs - View all account operation records

Access Control

  • Owner Only: Only owner accounts (isOwner=true) can log in to the Admin console
  • Local Key Storage: API Key is only stored in browser local storage, never uploaded to server
  • Session Management: Login state is stored in browser, requires re-login after closing page

Feature Details

Common Task Guide

Feature–Endpoint–Permission Matrix

Complete API endpoints and usage can be found in Admin API Reference

FeatureAPI DocumentationPermission
Provider managementAdmin API: Provider Key ManagementOwner only
Owner config (Model/Level/Resources/Limits)Admin API: System ConfigurationOwner only
News (system/targeted)Admin API: Broadcast NotificationsOwner only (system); Owner/ancestor (targeted)
Operation logsManage API: Operation LogsOwner only

Terminology: uses Model Mapper, Level Mapper, Resources (allowlist), Model Limits, Sleep, Switch Over β€” see "Terminology".

1. AI API Tab

Displays platform-supported AI service providers and SDK usage examples.

Features:

  • Model List Link - Dynamic display of /v1/models endpoint link
  • Supported AI Service Providers - Shows 9 major AI services (OpenAI, Anthropic, Perplexity, Mistral, Grok, Gemini, Cohere, DeepSeek, AI21)
  • SDK Example Code - Complete examples for OpenAI SDK and Anthropic SDK
  • One-Click Copy - Example code supports one-click copy

Related API: See Manage API: Model List

2. Model Services (Provider Management)

Manage upstream AI provider key pools with support for multiple provider types.

Features:

  • Statistics Cards - Display total levels, total keys, active keys
  • Add Provider - Support three configuration types:
    • Standard configuration (OpenAI, Anthropic, etc.)
    • Azure OpenAI configuration
    • Google Vertex AI configuration
  • Provider List - Display all providers grouped by level
  • Edit/Delete Provider - Support modifying provider configuration or deletion
  • Status Management - Enable/disable providers

Add Provider Form Fields:

  • Name - Provider name (optional, for identification)
  • Level - Load pool level (required, for routing)
  • Provider - Upstream API URL (required)
  • SecretKey - API key (required)
  • Standard Config - No additional fields
  • Azure Config - Model Mapping, API Version mapping
  • Vertex Config - Base URL, Project ID, Client Email, Private Key

Related API: See Admin API: Provider Key Management

3. System Configuration Tab

Manage owner-level system configuration parameters.

Configuration Items:

Owner Pricing Overrides:

  • A PRICING editor is available at the top of the tab (provide only deltas from system defaults).
  • Actions:
    • β€œLoad Current” reads configs.PRICING from backend
    • β€œSave Pricing (Apply Now)” writes PRICING via PUT /x-config
    • β€œClear (Restore Defaults)” removes PRICING via DELETE /x-config
  • Constraints: JSON size ≀ 128k, total entries ≀ 1024; unknown fields are rejected; all numbers must be finite and non‑negative.

Basic Configuration:

  • XAI_MAIL - System notification email
  • RESOURCES - Allowed API resource paths (comma-separated)
  • MODEL_LIMITS - Model-level rate limits (JSON format)

Email Configuration:

  • EMAIL_SMTP - SMTP server address
  • EMAIL_PORT - SMTP port
  • EMAIL_AUTH - Authentication email
  • EMAIL_PASS - Email password

Mapping Configuration:

  • MODEL_MAPPER - System model mapping (format: source=target)
    • Example: gpt-3.5*=gpt-4o-mini,gpt-4=gpt-4o
    • Purpose: Automatically convert requested models to other models
  • LEVEL_MAPPER - Model group mapping (format: model=level)
    • Example: gpt*=1,claude*=2,deepseek*=3
    • Purpose: Specify which level's provider pool handles which models
  • SWITCH_OVER - Model group primary/backup switching (format: primary=backup)
    • Example: 1=10,2=20
    • Purpose: When primary level has >5 errors in 1 minute, auto-switch to backup level

Related API: See Admin API: System Configuration

4. Broadcast Notifications Tab

Publish system-level or targeted user notifications.

Features:

  • Create Notification - Fill in title and content to publish notification
  • Notification List - View historical notification records
  • Delete Notification - Delete expired or incorrect notifications

Field Description:

  • title - Notification title (required, max 100 characters)
  • content - Notification content (required, max 1000 characters)

Related API: See Admin API: Broadcast Notifications

5. Operation Logs Tab

View all account operation records with pagination support.

Features:

  • Log Table - Display time, action, target account, details, IP address
  • Auto Pagination - Default 24 records per page
  • Real-time Update - Auto refresh when entering tab

Related API: See Manage API: Operation Logs


Use Cases

Use Case 1: Add Standard Provider

  1. Go to "Model Services" tab
  2. Fill in "Add Provider" form:
    • Name: OpenAI Production
    • Level: 1
    • Provider: https://api.openai.com
    • SecretKey: sk-...
  3. Click "Add Provider"
  4. System automatically adds gpt*=1 mapping to LEVEL_MAPPER

Use Case 2: Configure Azure OpenAI

  1. Go to "Model Services" tab
  2. Select configuration type: "Azure OpenAI Configuration"
  3. Fill in basic info and Azure-specific config:
    • Provider: https://your-resource.openai.azure.com
    • Model β†’ Deployment mapping: {"gpt-4o": "gpt-4-deployment"}
  4. Click add
  5. System automatically handles Azure-specific request routing

Use Case 3: Set Model Mapping

  1. Go to "System Configuration" tab
  2. In "System Model Mapping" enter:
    gpt-3.5*=gpt-4o-mini,o*=gpt-4o
    
  3. In "Model Group Mapping" enter:
    gpt*=1,claude*=2,deepseek*=3
    
  4. Click "Save Configuration"
  5. System automatically applies new mapping rules

Use Case 4: Publish System Notification

  1. Go to "Broadcast Notifications" tab
  2. Fill in notification title and content:
    • Title: System Maintenance Notice
    • Content: System will undergo maintenance tomorrow 2:00-4:00 AM...
  3. Click "Send Notification"
  4. All users will see this notification in Manage console

Best Practices

Provider Management

  1. Group by Service - Put same service provider's keys in same level
  2. Set Backup Switching - Use SWITCH_OVER to configure backups for critical levels
  3. Regular Check Sleeping Keys - View sleeping status in provider list
  4. Reasonable Level Setting - Divide different levels by cost, speed, reliability

Configuration Management

  1. Model Mapping Purpose - Use for smooth migration or cost optimization
  2. Careful RESOURCES Modification - Wrong config may cause API access issues
  3. MODEL_LIMITS Restrictions - Set strict rate limits for expensive models
  4. Regular Config Backup - Use /x-config endpoint to export configuration

Notification Management

  1. Important Notifications First - Use system-level notifications for critical information
  2. Concise Content - Avoid overly long notification content
  3. Timely Cleanup - Delete expired or invalid notifications

FAQ

Q: Why can't I log in to Admin console?

A: Only owner accounts can log in to Admin console. Sub-accounts should use Manage console.

Q: Models still can't be used after adding Provider?

A: Check the following:

  1. Does LEVEL_MAPPER include mapping for this model
  2. Is Provider status enabled
  3. Is SecretKey valid

Q: How to view system auto-added LEVEL_MAPPER?

A: You can view and modify in "System Configuration" tab's "Model Group Mapping" field.

Q: Is Azure config's API Version mapping required?

A: No, it's optional. If left empty, system will use default versions configured in environment variables.

Q: How to backup my configuration?

A: Use the following command to export configuration:

curl -H "Authorization: Bearer $API_KEY" \
  https://api.xaixapi.com/x-config > config-backup.json