Skip to main content

Error categories

Client errors (4xx) — caused by invalid requests. Fix the request before retrying. Server errors (5xx) — caused by infrastructure issues. Safe to retry with backoff. Job failuresstatus: failed in research results. Usually safe to resubmit.

Production-ready error handler

Handling specific error codes

Retry strategy

ErrorRetry?Strategy
credits_exhaustedWait for next billing cycle
invalid_keyFix configuration
invalid_email_formatFix input data
job_failedRetry once after 5s
5xx errorsExponential backoff, max 3 retries
polling_timeoutResubmit with fresh research_id

Logging

Always log the research_id — it’s essential for debugging with support: