Guide bot
The hub Guide answers product questions. It never receives seeds and must refuse import/export of keys.
Endpoint
POST /api/ai/guideOrigin: https://riddlewallet.com (same-origin from /guide and the in-app widget). Streams from https://api.x.ai/v1/chat/completions.
{ "messages": [{ "role": "user", "content": "How do suite credits work?" }] }No seeds, PINs, or private keys in the payload. messages is required.
Health: GET /api/ai/guide/health → { ok, configured, model }.
Server env
| Variable | Where | Role |
|---|---|---|
XAI_API_KEY | Server only | xAI key. Never NEXT_PUBLIC_*. Never ship to the browser. |
GUIDE_MODEL | Server | Model id. Default grok-4.6. |
GUIDE_DISABLED | Server | If 1, route returns 503. |
If XAI_API_KEY is missing, the route returns HTTP 503 (XAI_API_KEY is not configured). Do not fall back to a browser key.
Behavior
- Model: grok-4.6 unless
GUIDE_MODELoverrides - Success is SSE (
text/event-stream) from xAI - Daily IP cap (20) → 429
- Must refuse seeds, PINs, exploits, and return promises
- Cites
/apps,/features,/docs,/start - Fees / credits facts must match fees & credits
Client
The Guide widget is owned by the hub shell. Feature pages should not fork a second bot. Docs for humans: https://riddlewallet.com/guide.