Skip to content
mentoor

Errors, rate limits and retries

For engineers

Classifying API errors, staying under rate limits, retrying with backoff, setting timeouts and falling back to other models

See where you stand

110 questions across four stages: Understand, Apply, Solve and Judge.

Try 5 questions

Practice items, not counted towards your mastery. No account needed.

Check yourself · 1 of 5

Your call returns HTTP 400 with an invalid_request_error body. What is the right response?

Choose one answer

Check yourself · 2 of 5

A batch job sends short prompts but hits 429 even though it is far below its requests-per-minute limit. What is the most likely cause?

Choose one answer

Check yourself · 3 of 5

What does adding jitter to a backoff schedule achieve?

Choose one answer

Check yourself · 4 of 5

Why is a 5 second total timeout a poor choice for a call that generates a long report?

Choose one answer

Check yourself · 5 of 5

Which error is the best trigger for switching to a backup model?

Choose one answer

Topics

  1. Reading API error types and status codes5 min read · Invalid request, authentication, permission, payload too large, rate limit, server and overloaded errors, and which of them are worth retrying
  2. Staying under request and token rate limits5 min read · Requests and tokens per minute, usage tiers, rate-limit response headers and client-side throttling
  3. Retrying with exponential backoff and jitter5 min read · Honouring retry-after, capping attempts, adding jitter and not stacking your retries on top of the SDK's
  4. Setting timeouts for long model generations5 min read · Connect, read and total deadlines sized to output length, SDK defaults and streaming for long requests
  5. Falling back to another model or provider5 min read · Switching on overload or outage, keeping prompts compatible and checking the fallback still meets the output contract

Start here

Helps to know first

110 questions · last verified 2026-12