Preventing continuous fake API requests

in the API endpoint :

curl -X "POST" http://localhost:8000/api/signup -H 'Content-Type: application/json' -d '{"username":"username-1","password":"pa$$w0rd"}'

How do we prevent someone from writing a script and generating usernames and hitting in signup requests every second ? I want to block like multiple fake requests. Normally many regular traditional sites have reCaptcha.

if u are using Django Rest Framework, u can check this: python - How to secure APIs for Registration and Login in Django Rest Framework? - Stack Overflow

Thank you very much croolic.