Errors
Error categories and handling guidance for OptimAI Search API consumers.
Handle errors by category, not only by message text.
| Status | Meaning | Action |
|---|---|---|
400 | Invalid request shape | Fix the payload. |
401 | Missing or invalid key | Check authentication. |
402 | Payment or credit required | Ask the user to add credits or payment. |
429 | Rate limited | Back off and retry later. |
5xx | Temporary service issue | Retry with backoff if safe. |
Preserve context
Log the status code, endpoint, and request ID when available.