Owner Config API
All endpoints require the ownerβs API key (must be the account owner).
β
Endpoints
- Get config:
GET /x-config
- Update config:
PUT /x-config
(alsoPOST
) - Delete config keys (restore defaults):
DELETE /x-config
- Owner overview (with keys state):
GET /x-conf
β
Config keys
Routing and access
MODEL_MAPPER
user-level model aliasing, e.g.gpt-3.5*=gpt-4o-mini, o*=gpt-4o
LEVEL_MAPPER
model β Level mapping, e.g.gpt-4*=2, claude*=3
SWITCH_OVER
Level fallback order, e.g.1=2,2=3
RESOURCES
allowed API paths (comma/whitespace separated), e.g./v1/chat/completions,/v1/embeddings
MODEL_LIMITS
per-model rate limits (JSON):{ "gpt-4o": {"rpm": 30, "tpm": 90000}, "claude-3-opus": {"rpm": 20, "tpm": 60000} }
Email (used by signup/notifications)
XAI_MAIL
,EMAIL_PORT
,EMAIL_SMTP
,EMAIL_AUTH
,EMAIL_PASS
,EMAIL_TLS
β
Get config
curl -H "Authorization: Bearer $API_KEY" \
https://api.xaixapi.com/x-config | jq .
Sample response (excerpt)
{
"success": true,
"oid": 1,
"configs": {
"MODEL_MAPPER": {"gpt-3.5*": "gpt-4o-mini"},
"LEVEL_MAPPER": {"gpt-4*": 2, "claude*": 3},
"SWITCH_OVER": {"1": 2},
"RESOURCES": {"/v1/chat/completions":{},"/v1/embeddings":{}},
"MODEL_LIMITS": {"gpt-4o": {"rpm": 30, "tpm": 90000}},
"EMAIL_SMTP": "smtp.gmail.com",
"EMAIL_TLS": true
}
}
β
Update config
- Endpoint:
PUT /x-config
- Content-Type:
application/json
Body (batch update)
{
"MODEL_MAPPER": "gpt-3.5*=gpt-4o-mini, o*=gpt-4o",
"LEVEL_MAPPER": "gpt-4*=2, claude*=3",
"SWITCH_OVER": "1=2,2=3",
"RESOURCES": "/v1/chat/completions, /v1/embeddings",
"MODEL_LIMITS": "{\n \"gpt-4o\": {\"rpm\": 30, \"tpm\": 90000}\n}",
"EMAIL_SMTP": "smtp.gmail.com",
"EMAIL_TLS": "true"
}
Formats
- Mappers (
MODEL_MAPPER
,LEVEL_MAPPER
,SWITCH_OVER
) usek=v
comma-separated pairs; keys/values are trimmed. RESOURCES
accepts comma and/or whitespace separated path items; each path is validated.MODEL_LIMITS
accepts a JSON string or object. With an object, values are merged; passing*
or=
resets to empty.
β
Delete config keys
- Endpoint:
DELETE /x-config
{ "keys": ["MODEL_MAPPER", "SWITCH_OVER"] }
The keys are removed from the owner config, version bumped, defaults restored, and an update event is published.
β
Interaction with keys
- When a new key is added, the system may auto-augment
LEVEL_MAPPER
for the owner by matching provider patterns (including similarity matching) so models route to the right Level. GET /x-conf
provides a consolidated view including sleeping/disabled keys and thresholdsUserMinBalance
andUserApiBalance
.