Admin API Reference
This page is aligned with the current backend implementation (api/main.go + api/handler/*.go) and includes only public Admin interfaces.
Base Information
- Base URL:
https://api.xaicontrol.com - Auth:
Authorization: Bearer sk-Xvs... - Permission:
Ownerrole can access all endpoints on this page
export BASE_URL="https://api.xaicontrol.com"
Endpoint Overview
| Module | Method | Endpoint | Description |
|---|---|---|---|
| Key management | GET | /x-keys | List keys (filter + pagination) |
| Key management | GET | /x-keys/{id} | Filtering |
| Key management | POST | /x-keys | Create key |
| Key management | PUT/POST | /x-keys/{id} | Update key |
| Key management | DELETE | /x-keys/{id} | Delete key |
| Config inspection | GET | /x-conf | Read owner config and key status summary |
| Config batch update | POST | /x-conf | Batch update config |
| Config CRUD | GET/PUT/POST/DELETE | /x-config | Owner config CRUD |
| User detail | GET | /x-info?user={id or name} | Query detailed user info |
1) Key Management (/x-keys)
1.1 List keys
GET /x-keys
Query params:
idlevelproviderpage,size
Path filters:
/x-keys/123/x-keys/L2/x-keys/api.openai.com
Response is an array. Pagination headers: X-Total-Count, X-Page, X-Per-Page, X-Total-Pages.
curl -H "Authorization: Bearer $API_KEY" \
"${BASE_URL}/x-keys?page=1&size=20&level=2"
1.2 Create key
POST /x-keys
{
"Name": "OpenAI Primary",
"Level": 1,
"Provider": "https://api.openai.com",
"SecretKey": "sk-xxxxxxxxxxxxxxxxxxxx",
"Status": true,
"config": {
"provider_type": "standard"
}
}
1.3 Update key
PUT /x-keys/{id} or POST /x-keys/{id}
Updatable fields: Name, Level, Provider, SecretKey, Status, config.
1.4 Delete key
DELETE /x-keys/{id}
2) Batch Config (/x-conf)
2.1 Get config
GET /x-conf
Core fields:
ResourcesLevelMapperModelMapperModelFailoverModelLimitsSwitchOverSleepingKeysDisabledKeysUserMinBalanceUserApiBalance
2.2 Batch update
POST /x-conf
Common fields:
ResourcesLevelMapperModelMapperModelFailoverModelLimits
ModelLimits accepts object payloads or command strings (e.g. * to clear, -model to remove).
3) Config CRUD (/x-config)
3.1 Get config
GET /x-config
Returns configs, including MODEL_MAPPER, MODEL_FAILOVER, LEVEL_MAPPER, SWITCH_OVER, RESOURCES, MODEL_LIMITS, PRICING, etc.
3.2 Update config
PUT /x-config or POST /x-config
The backend parses request body as map[string]string; use string values.
3.3 Delete config keys
DELETE /x-config
{
"keys": ["MODEL_MAPPER", "PRICING"]
}
4) User Detail (/x-info)
GET /x-info?user={id or name}
useris required- Limited to users inside the current owner tree
- Returns balances, limits, ACLs, mappings, and usage detail
Internal maintenance/correction interfaces are intentionally excluded from this public document.