Next.js Discord

Discord Forum

How "Playground" sdk.vercel.ai to handle allowing users query without login?

Unanswered
American Chinchilla posted this in #help-forum
Open in Discord
American ChinchillaOP
Hey devs. I'm trying to build an app similar to "Playground" app in https://sdk.vercel.ai/. Even if you open this website on Incognito this "Playground" app allows users to query various AI APIs (ChatGPT, Gemini, Llama, Claude) without logging in and then ask user to logging in. My question:

What's the secret sauce to allow users to query APIs without requiring them to log in?

8 Replies

American ChinchillaOP
Is there a way to use same api key but for each user it allows use the token free allowance and if reach the max limit charge the client. Is there any example ?
Count the number of requests from an ip address and limit it I guess. Though it won’t be 100% secure, all public restrictions can be bypassed one way or another.
Only offer public LLM playgrounds if you can afford it
cloudflare has free captchas including invisible ones that check the browser and give a key that will allow that user to make requests on the api
ip could work too, but if you use a service like cloudflare they often have anti-vpn and anti-proxy stuff implemented in that invisible browser check
that wont be giving each user a token, just making it more annoying to mass abuse your api endpoint (if you use the browser like normal, it wont notice anything)