This happens when the Groq API request fails. Here's how to diagnose and fix:
Your current keys in .env look suspicious (they appear to be test/placeholder keys).
Get real Groq API keys:
- Go to: https://console.groq.com
- Sign up or log in
- Create an API key
- Copy it and paste into
.env:
GROQ_API_KEY=gsk_xxxxxxxxxxxxxxxxxxxxxxxxxxxx
GROQ_API_KEY2=gsk_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyStart your server first:
npm startThen test your API keys using the new test endpoint:
# Test Groq API keys
curl -X POST http://localhost:3000/test/groq-keys
# Test Binance connection
curl -X POST http://localhost:3000/test/binance
# Test full analysis flow
curl -X POST http://localhost:3000/test/full-analysis \
-H "Content-Type: application/json" \
-d '{"symbol":"BTCUSDT","question":"Is BTC bullish?"}'Look for errors in the server logs. The test endpoint will show:
- ✓ VALID if the API key works
- ✗ INVALID if there's an auth issue
- ERROR if there's a network issue
- Your Groq API key is wrong/expired
- Fix: Get a new key from https://console.groq.com
- Can't reach Groq servers or Binance API
- Fix: Check your internet connection, try
ping api.groq.com
- Binance API is slow or not responding
- Fix: Try again, or increase timeout in
src/services/binance.js(currently 15s)
- Open http://localhost:3000
- Type your question: "Is BTC bullish?"
- If it works: You'll see an analysis ✓
- If it fails: You'll see a detailed error message
Check these files for detailed logs:
- Server console output
- Browser console (F12 → Console tab)
The error messages now include:
- What went wrong
- Why it happened
- Where to get help