Errors

Error categories and handling guidance for OptimAI Search API consumers.

Handle errors by category, not only by message text.

StatusMeaningAction
400Invalid request shapeFix the payload.
401Missing or invalid keyCheck authentication.
402Payment or credit requiredAsk the user to add credits or payment.
429Rate limitedBack off and retry later.
5xxTemporary service issueRetry with backoff if safe.

Preserve context

Log the status code, endpoint, and request ID when available.