API Reference
API Reference
This section documents the main XAI Router endpoints implemented in the current codebase.
Documentation Map
-
- OpenAI/Anthropic-compatible proxy routes
- Dashboard query routes (
/dashboard/*)
-
- Key pool management (
/x-keys) - Owner configuration (
/x-conf,/x-config) - News management (
/x-news)
- Key pool management (
-
- Subaccount management (
/x-users,/x-dna) - Descendant billing (
/x-bill) - Self-service actions (
/x-self)
- Subaccount management (
Quick Examples
Mode & Domain
export BASE_URL="https://api.xairouter.com" # SaaS single-tenant
# export BASE_URL="https://api.xaicontrol.com" # BYOK multi-tenant
Standard auth header
Authorization: Bearer sk-Xvs...
Call proxy endpoint
curl ${BASE_URL}/v1/chat/completions \
-H "Authorization: Bearer $API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-4o-mini","messages":[{"role":"user","content":"hello"}]}'
Check current account status
curl ${BASE_URL}/dashboard/status \
-H "Authorization: Bearer $API_KEY"