Hello everyone. I was wondering if there’s a way I can send more HTTP request since my game uses an AI from https://huggingface.co/ and it reaches the limit too quick and it’s literally unplayable.
The limit is 500 per minute, which means on average, your game is sending 8 http requests per SECOND. How are you reaching the limit? What are you using this website for?
I wasn’t sending 8 request per second, it was a manual request so the player sends it when they press a button and also has a cooldown of 3 seconds, it just stopped.
Can you send what code you’re using?
Continuing the discussion from Is there anyway to send more HTTP requests:
The website only allow 30,000 character per mont on the free version
Try Inference API: CPU
Up to 30k input characters /mo
This is the code I used,
local HttpService = game:GetService("HttpService")
local data = { ["inputs"] = "Once upon a time," }
local json = HttpService:JSONEncode(data)
local response = HttpService:PostAsync("https://api-inference.huggingface.co/models/EleutherAI/gpt-neo-1.3B", json)
local decoded = HttpService:JSONDecode(response)
print(decoded[1].generated_text)
also in their site, it says that I can send over 10k request per minute? but I suddenly got a 429 error (Too many request)
Can you show me the link source?
oh, but I don’t think I’ve already reached the limit? also would it still have a limit if I don’t use an account?
HttpService doesn’t throw Http errors, it just throws a regular error
Maybe the website you’re using has a different limit if you don’t have an account?
it returns an error saying “Error 429 (Too much request)”, is it possible that it maybe from the site?
Yeah, it’s most likely from the website.
oh, okay. I tried it again and it works now
An HTTP 429 indicates a ratelimit response, meaning you’ve hit the max number of requests you can make for a given amount of time. Nothing can be done on your end for this as the response and limits are set by the site (in this case, HuggingFace). You could in theory avoid this, however, by using a self-hosted rotating proxy.
what is a self-hosted rotating proxy, and how can I use it? can you explain please
“Self hosted” means you are hosting it yourself.
A rotating proxy is essentially a server that uses different IPs to execute the same task many times (since ratelimits are IP based). You can search for it for more information.