riddleHUB

Docs · Guide bot

Developers

Guide bot

The hub Guide answers product questions. It never receives seeds and must refuse import/export of keys.

Endpoint

POST /api/ai/guide

Origin: 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

VariableWhereRole
XAI_API_KEYServer onlyxAI key. Never NEXT_PUBLIC_*. Never ship to the browser.
GUIDE_MODELServerModel id. Default grok-4.6.
GUIDE_DISABLEDServerIf 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_MODEL overrides
  • 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.