π 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 models from all the AI service providers listed above. With a single API key, you can seamlessly call AI models from any of these providers, enabling flexible and efficient AI application development.
π» SDK Code 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)
Total Levels
-
Total Keys
-
Active Keys
-
Sleeping Keys
-
Add New Provider
Provider List
Loading...
System Configuration Management
Model Pricing (Owner Overrides)
Provide only the deltas from system defaults. Applied immediately; requests prefer Owner overrides and fall back to defaults.
β
Limits: total entries β€ 1024, size β€ 128k.
Subscription Plans (Monthly)
Push sellable monthly plans to the frontend. Prices β₯ 10000 hide the plan on the user side for temporary takedowns.
Fields: code, name, price_yuan (or price_fen), rpm, tpd, allow_models, gear, level, credit_amount, duration_days, active (optional). Price is used for upgrade detection (higher price = better plan). Price β₯ 10000 hides the plan.
Create New Broadcast
Broadcast History
Loading...
Operation Logs
| Time | Action | Target Account | Details | IP Address |
|---|
Loading logs...
No operation logs found