Lilite now uses a server-managed /api/chat endpoint so the Groq API key stays off the client.
Create .env.local at project root:
GROQ_API_KEY=gsk_your_real_key_hereRules:
- No spaces around
= - No quotes
- No semicolon
Restart dev server after env changes:
npm run dev- Go to
Project Settings->Environment Variables - Add
GROQ_API_KEYwith yourgsk_...value - Apply to
ProductionandPreview(andDevelopmentif needed) - Redeploy
- Browser clients call the local/project endpoint:
/api/chat
If chat fails:
- Ensure
GROQ_API_KEYstarts withgsk_ - Ensure the key is active and not revoked
- Restart
npm run devafter changing env variables - Check browser DevTools
Networktab for request errors