Can you set a max USD amount for Workers Unlimited billing?

Is there a way to set a max amount I want to spend per month so that I don’t get charged if someone DDOSes me, spams requests, or tries attacking my workers? For example, I’d like to be able to set a limit of $5 per month and then if I reach that limit, all other requests will fail (or get forwarded to my origin).

I don’t want to go in debt to cloudflare so I’d like to be able to set a limit so that I don’t spend more than I can afford (and cause my PayPal to go into the negative, have my bank account over-drafted, etc).

As far as I know there is no way to do that, you could set-up something like rate-limiting, but it costs per each valid (as in not rate limited) request, way more than what Workers would. Not sure if there a solution here, apart from the fact that Workers are extremely cheap regardless, 0.50$/1M is nothing…

Couldn’t figure out a way via API, maybe in the future that data will be available through the API.
On the Workers Dashboard submit your request and feedback.

1 Like

Workers are extremely cheap regardless, 0.50$/1M is nothing…

True, but I still want to be cautious anyway. I’ve heard horror stories from people using serverless and being charged a lot more than they expected, so I just want to be careful since I’m still new to this kind of stuff

There are way different pricing models though, on the “normal” serverless stuff (Cloud Functions for GCS and Azure, Lambda for AWS) they bill per usage of CPU, RAM and bandwidth, so if you manage to force a function to run until timeout you are increasing cost-per-request, same as high bandwidth responses.

On Workers the cost is fixed, you pay a certain amount per request, to make you pay a lot you need to have a lot of requests. You could put an alert on the total spending amount and in case disable them manually. That can be done in the billing/notification settings.

2 Likes