This is not related to the API key or account running out of funds. but rather due to the agent invoking a very high number of requests within a very short period of time.
It can be resolved by introducing a delay between requests. it would be nice to have this configuration option in cursor settings.
Slower but complete execution is better than having work interrupted mid-way then asking the agent to pick up from where he stopped.
Edit: I think this issue happens specifically when using own Anthropic api key. I tested using Cursor API key and the issue is not happening so far.