feat(ai): free Groq AI analysis via Cloudflare Worker proxy#306
Merged
AugustoL merged 2 commits intoopenscan-explorer:devfrom Mar 12, 2026
Merged
feat(ai): free Groq AI analysis via Cloudflare Worker proxy#306AugustoL merged 2 commits intoopenscan-explorer:devfrom
AugustoL merged 2 commits intoopenscan-explorer:devfrom
Conversation
Add openscan-groq provider that proxies AI requests through a Cloudflare Worker, allowing users to use AI analysis without configuring their own API key. Worker: Hono app with CORS origin allowlist, per-IP rate limiting (10 req/min), payload validation, and Groq API forwarding. Frontend: new openscan-groq provider (first in priority order), callOpenScanProxy method in AIService, keyless resolution in useAIAnalysis hook, filtered from Settings API key UI. Closes openscan-explorer#269
|
🚀 Preview: https://pr-306--openscan.netlify.app |
Netlify previews use -- separator (pr-306--openscan.netlify.app), not subdomain dots. Update wildcard pattern and matching logic.
josealoha666
approved these changes
Mar 12, 2026
Collaborator
josealoha666
left a comment
There was a problem hiding this comment.
Reviewed the diff locally. The keyless provider wiring looks coherent, the worker-side CORS/rate-limit/validation guards make sense, and typecheck/test/build passed for me. Nice fix on the Netlify preview origin matching too.
MatiasOS
approved these changes
Mar 12, 2026
This was referenced Mar 16, 2026
Merged
Collaborator
josealoha666
left a comment
There was a problem hiding this comment.
Quick review: I skimmed the diff and did not find a clear blocker. Leaving a comment-only review for now.
Collaborator
josealoha666
left a comment
There was a problem hiding this comment.
I checked the current head and I do not see an obvious blocking issue from the diff/API view. If CI is green, this looks fine from my side.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a free AI analysis tier powered by Groq through a Cloudflare Worker proxy. Users can now use AI analysis out of the box without configuring their own API key.
Related Issue
Closes #269
Type of Change
Changes Made
Cloudflare Worker (
worker/)POST /ai/analyzeendpointGROQ_API_KEYsecretFrontend Integration
openscan-groqtoAIProvidertypeOpenScan Groqprovider config (keyless, first in priority order)callOpenScanProxy()method inAIService— posts to worker with{ type, messages }, no Authorization headerresolveProvider()inuseAIAnalysisto returnopenscan-groqwithout checking for an API keyopenscan-groqfrom Settings API key UI (no key to configure)REACT_APP_OPENSCAN_GROQ_AI_URLenv var in Vite configAllowed Origins
http://openscan.eth.linkhttps://openscan-explorer.github.iohttps://openscan.netlify.app*.openscan.netlify.app(preview deploys likehttps://pr-123--openscan.netlify.app)Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsnpm run test:runAdditional Notes
https://openscan-groq-ai-proxy.openscan.workers.devwith the Groq API key configured as a secret