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/docsAnthropic
docs.anthropic.comPerplexity
docs.perplexity.aiMistral AI
docs.mistral.aiGrok AI
docs.x.aiGemini
ai.google.devCohere
docs.cohere.comDeepSeek
api-docs.deepseek.comAI21
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
API Call Examples
cURL
Python
JavaScript
Fund/Deduct Sub-account
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
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
Current Order
Recharge History
No recharge records
View Sub-account Information
API Call Examples
cURL
Python
JavaScript
Update Sub-account Information
API Call Examples
cURL
Python
JavaScript
Sub-account List
0 sub-accountsNo sub-accounts yet
This account has no sub-accounts
Delete Sub-account
This action cannot be undone. The sub-account Key will be immediately invalidated.
API Call Examples
cURL
Python
JavaScript
Sub-account Insights
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