Budget polling across all active tasks
Two jobs polled once per second can exhaust the key's allowance before your app makes other useful requests. Repeated polling does not accelerate generation. The status route can advance an existing task's reconciliation, but it does not submit a new generation. Keep one backend poller per job and distribute safe state to clients. Compute a request budget across all workers sharing the key; a ten-second example for two jobs is twelve polls per minute, not a claim that the result completes within ten seconds.
What to do next
- 01
Use the returned route
Persist poll_url with the job ID and request it through your authenticated backend. Avoid constructing a new generation POST as a substitute for asking about the existing job.
- 02
Stop unnecessary checks
End normal polling at completed or failed. For unknown, keep the task visible and use a cautious recovery path instead of treating it as a completed failure to retry automatically.
- 03
Back off on limits
Respect Retry-After when a 429 response is received. Coordinate other workers sharing the key so they do not immediately consume the next request window together.
A concrete example
Illustrative schedule: one worker polls two jobs every ten seconds and caches their safe statuses for the browser. Several open tabs read that cache instead of each running another independent poller against AISwapLab.
Illustrative request-budget check
| Workload | Poll requests per minute | Other considerations |
|---|---|---|
| Two jobs, each every ten seconds | 12 | Leaves room within the current per-key limit for other authenticated work |
| Two jobs, each every second | 120 | Already exceeds the documented 30/minute/key path |
| Several tabs viewing one job | Use one backend poller and cached safe state | Tabs should not multiply upstream polling |
Before you call it ready
- Polling has an explicit interval and end condition.
- All requests sharing the key are considered.
- A 429 does not cause another generation.
When to stop or choose another method
If the polling budget is exhausted, reduce redundant checks and wait. Creating more credentials solely to evade a service limit is not a sound recovery strategy.
