Spec a client-side limit for a partner API quota
Your task
Your Go sync job calls a partner's API from many goroutines at once. The partner allows 100 requests per second per API key and answers 429 when you go over. After 3 days with too many 429 responses, they suspend the key. An agent will add rate limiting to the client.
Write the spec you would hand the agent.
What you know:
- one process runs the sync, and it is the only user of this API key
- about 200 goroutines make calls, and each call takes 50 to 500 ms
- the partner counts requests in any rolling 1-second window
- a 429 response carries a
Retry-Afterheader, in seconds
Then, in a few sentences: what does "throttle the API calls to 100 per second" get wrong?