Rate Limit
When you share your chatflow to public with no API authorization through API or embedded chat, anybody can access the flow. To prevent spamming, you can set the rate limit on your chatflow.
- Message Limit per Duration: How many messages can be received in a specific duration. Ex: 20
- Duration in Seconds: The specified duration. Ex: 60
- Limit Message: What message to return when the limit is exceeded. Ex: Quota Exceeded
Using the example above, that means only 20 messages are allowed to be received in 60 seconds. The rate limitation is tracked by IP-address. If you have deployed AnswerAI on cloud service, you'll have to set NUMBER_OF_PROXIES
env variable.
Cloud-Hosted Rate Limit Setup Guide
- Cloud Host AnswerAI: Start by hosting AnswerAI in the cloud.
- Set Environment Variable: Create an environment variable named
NUMBER_OF_PROXIES
and set its value to0
in your hosting environment. - Restart Cloud-Hosted AnswerAI Service: This enables AnswerAI to apply changes of environment variables.
- Check IP Address: To verify the IP address, access the following URL:
{{hosted_url}}/api/v1/ip
. You can do this either by entering the URL into your web browser or by making an API request. - Compare IP Address After making the request, compare the IP address returned to your current IP address. You can find your current IP address by visiting either of these websites:
- Incorrect IP Address: If the returned IP address does not match your current IP address, increase
NUMBER_OF_PROXIES
by 1 and restart Cloud-Hosted AnswerAI. Repeat this process until the IP address matches your own.