Skip to main content
Model provider endpoints can be busy places; sometimes an LLM request will time out. When that happens, dartantic will invoke its built-in retry logic to handle temporary rate limits and failures.

Zero Configuration

The HTTP 429 “Too Many Requests” client error response status code indicates that the client has sent too many requests within a given time period. This mechanism, known as “rate limiting,” is employed by servers to prevent overload, ensure fair resource usage, and mitigate potential abuse or denial-of-service attacks. When dartantic gets a 429 response, it will retry automatically without you having to do anything:
final agent = Agent('openai');

// Automatically retries on 429 errors
final result = await agent.send('Hello!');

Timing Strategy

Dartantic will use an incremental backoff algorithm along with a random “jitter” to see if it can get a response to go through.
Attempt 1: Immediate
Attempt 2: 1s + jitter
Attempt 3: 2s + jitter  
Attempt 4: 4s + jitter

Next Steps