π—π€πˆ π—π€ππˆ

π»π‘œπ‘™π‘œπ‘”π‘Ÿπ‘Žπ‘β„Žπ‘–π‘ Β· 𝑆𝑒𝑏-π‘–π‘›π‘“π‘œπ‘Ÿπ‘šπ‘Žπ‘‘π‘–π‘œπ‘› πΆπ‘œπ‘›π‘π‘’π‘π‘‘ 𝐷𝑒𝑠𝑖𝑔𝑛

Don't have an account?Sign up·User Manual

Activation code and API key will be sent to this email. (May be delayed or filtered as spam.)

Verification Code Sent!

Please click the activation link in your email to complete registration.

API Base URL:

The API Key will also be included in the activation email. Please keep it safe.

May be delayed or in spam.

Already have an account? Login now

Β© 2022-2026 XABC Labs

π—π€πˆ π—π€ππˆ

Sub-account tools are disabled for this account. To manage sub-accounts, please use a pay-as-you-go account with a balance greater than the sub-account threshold, or contact an admin.

Today's real-time usage statistics

You can query data within 3 years

Total Cost

\$0.00

Total Requests

0

Total Tokens

0

Images

0

Input Tokens

0

Output Tokens

0

Cache Tokens

0

Model Cost Distribution

Model Request Distribution

Model Usage Details

Model Requests Input Tokens Output Tokens Cache Tokens Images Cost Percentage

Daily Usage Statistics

Date Requests Cost Tokens Images Primary Model

Account Balance Query

Supported format: XAI API Keys starting with sk-Xvs...

Query Results

🌐 Supported AI Service Providers

OpenAI

platform.openai.com/docs

Anthropic

docs.anthropic.com

Perplexity

docs.perplexity.ai

Mistral AI

docs.mistral.ai

Grok AI

docs.x.ai

Gemini

ai.google.dev

Cohere

docs.cohere.com

DeepSeek

api-docs.deepseek.com

AI21

docs.ai21.com

✨ The XAI platform fully supports all models from the above AI service providers. With a single API key, you can seamlessly access AI models from any of these providers, enabling flexible and efficient AI application development.

πŸ’» SDK Examples

OpenAI SDK Example

import os
from openai import OpenAI

XAI_API_KEY = os.getenv("XAI_API_KEY")
client = OpenAI(
    api_key=XAI_API_KEY,
    base_url="",
)

completion = client.chat.completions.create(
    model="gpt-4o",
    messages=[
	{"role": "system", "content": "You are AI"},
	{"role": "user", "content": "What is the meaning of life, the universe, and everything?"},
    ],
)

print(completion.choices[0].message)

Anthropic SDK Example

import os
from anthropic import Anthropic

XAI_API_KEY = os.getenv("XAI_API_KEY")
client = Anthropic(
    api_key=XAI_API_KEY,
    base_url="",
)
message = client.messages.create(
    model="claude-sonnet-4-5-20250929",
    max_tokens=128,
    system="You are AI.",
    messages=[
	{
	    "role": "user",
	    "content": "What is the meaning of life, the universe, and everything?",
	},
    ],
)
print(message.content)

πŸ§ͺ cURL Examples

OpenAI /chat/completions

curl https://api.xairouter.com/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $XAI_API_KEY" \
  -d '{
    "model": "gpt-5.2",
    "messages": [
      {
        "role": "developer",
        "content": "You are a helpful assistant."
      },
      {
        "role": "user",
        "content": "Hello!"
      }
    ]
  }'

Anthropic /messages

curl https://api.xairouter.com/v1/messages \
  -H 'Content-Type: application/json' \
  -H 'anthropic-version: 2023-06-01' \
  -H "X-Api-Key: $XAI_API_KEY" \
  -d '{
    "max_tokens": 1024,
    "messages": [
      {
        "content": "Hello, world",
        "role": "user"
      }
    ],
    "model": "claude-sonnet-4-5-20250929"
  }'

Create New Sub-account

Username must be unique and cannot duplicate existing accounts
Email address must be unique and cannot duplicate existing accounts

API Call Examples

cURL

Python

JavaScript

Fund/Deduct Sub-account

Support query by username or user ID

API Call Examples

cURL

Python

JavaScript

Top Up Your Account

Use WeChat to add credits to this account. Once the payment is confirmed, the balance will update automatically

Monthly Quickly enable target models
Loading subscription plans...
Pay-as-you-go alternative to monthly plans; minimum 10 CNY

WeChat Pay

The generated QR code will be displayed here

Scan with WeChat to Pay

Customer Support

Need help with a recharge, invoice, or issue? Scan to add WeChat support and mention β€œXAI”.

  • Hours: Weekdays 10:00 - 19:00 (Beijing time)
  • Have your order number or account email ready for faster assistance

The support QR code will appear here

Support WeChat QR code

Current Order

Order
Amount
Credit Granted
Status
Awaiting Payment

Recharge History

No recharge records

View Sub-account Information

Leave empty to display all sub-account information

API Call Examples

cURL

Python

JavaScript

Update Sub-account Information

Enter the username or user ID of the sub-account to update

Basic Information

Quota Settings

Rate Limits

Model-Specific Limits

Quick fill
Supports JSON; you can also enter "*" to clear all, or "-gpt-4o, -gpt-4o-mini" to remove specific models. Each model can have rpm, rph, rpd, tpm, tph, tpd limits. Leave empty to keep current settings.

Access Control

Model mapping is incremental: "-key" removes, "*" clears.

API Call Examples

cURL

Python

JavaScript

Sub-account List

0 sub-accounts
Loading sub-accounts...

No sub-accounts yet

This account has no sub-accounts

Page 1 / 1 Β· Total 0

Delete Sub-account

This action cannot be undone. The sub-account Key will be immediately invalidated.

Please carefully confirm the sub-account identifier to delete

API Call Examples

cURL

Python

JavaScript

Sub-account Insights

to

Loading billing data...

Failed to load billing data

Please verify network access and API permissions, then retry

Total Cost

$0.00

Total Requests

0

Total Tokens

0

Total Images

0

Input Tokens

0

Output Tokens

0

Cache Tokens

0

Model Cost Distribution

Model Request Distribution

Cost Trend Analysis

Daily Trend

Model Spend & Requests

Summarize request share and cost structure to pinpoint primary cost drivers.

Model Requests Prompt Completion Spend Request Share Spend Share

Sub-account Overview

Compare sub-account request and spend distribution to flag anomalies quickly.

User Requests Input Tokens Output Tokens Cache Tokens Images Spend Spend Share

Daily Timeline

Review daily totals, model share, and cache hits across the selected range.

Activity Logs

Time Action Target Account Details IP Address

Loading logs...

No activity logs available

Operation Result



          

πŸ”‘ Secret Key

Please keep this key secure, it will be used for sub-account API authentication

πŸ’‘ Tip: Please notify the sub-account owner to check their email for the API key

Sub-account Editor

Sub-account

Basic Info

Usage Limits

Rate Limits

Models & Access

Model mapping is incremental: use "*" or "=" to clear, "-key" to remove.
Supports JSON; use "*" or "=" to reset, or "-gpt-4o" to remove a model.

Other

Confirm Action