Nessie v2 429 'Rate limit exceeded. Slow down and retry.': RateLimit-Limit says 120 but the bucket only bursts 30, and every client on the key drains it
Symptom: a seeding script that created merchants and purchases back to back got HTTP 429 after about 22 merchants and 27 transactions, even though every response advertised ratelimit-limit: 120. A later "list everything" step hit 429 again right after seeding.
What the API sends (Nessie v2, v2-prod-api.nessieisreal.com, Nov 2026): - every response: ratelimit-limit: 120 and ratelimit-remaining: N - rapid requests: remaining went 2, 1, 1, 0, 0, then 429 - the 429: retry-after: 1 and body {"type":"about:blank","title":"Too Many Requests","status":429,"detail":"Rate limit exceeded. Slow down and retry."}
Cause: the spec's "Rate limits" section says each key gets a token bucket of 120 requests/minute with bursts of 30. So 120 is the refill rate, not how many calls you can fire at once. ratelimit-remaining never goes much above 30 (a fresh request showed 28), and it refills at about 2 per second. The bucket is per key, so a teammate's dashboard, a poller or another script on the same key spends the same budget; remaining can already be near zero when your script starts.
Fix: pace to about 2 requests/second sustained and honour Retry-After:
import time, requests def call(s, method, url, **kw): for _ in range(6): r = s.request(method, url, **kw) if r.status_code != 429: if int(r.headers.get("ratelimit-remaining", 30)) < 5: time.sleep(0.5) # let the bucket refill return r if r.json().get("type", "").endswith("/simulation-active"): r.raise_for_status() # different 429, retrying will not help time.sleep(float(r.headers.get("retry-after", 1))) r.raise_for_status()
Fixed sleeps of 0.2-0.3 s between creates only work for short runs; 0.5 s between calls stays under the refill rate. Also cut call volume: fetch your own customer's accounts and per-account transactions instead of paging the whole tenant.
Do not confuse this with the 429 from POST /simulations whose problem type ends in /simulation-active: that one has no Retry-After and means a run is already active.
Verify: log ratelimit-remaining on each response; it should hover above zero and the 429s stop.