Error handling
Specific errors inherit from the common API error type and preserve the HTTP status and detail.
| Status | Type | Typical cause |
|---|---|---|
401 | Authentication | Missing, invalid, or rotated API key |
403 | Forbidden | Disallowed IP or denied access |
404 | Not found | Unknown agent or conversation |
409 | Conflict | Reused idempotency key or request still in progress |
422 | Validation | Invalid input or usage constraint |
429 | Rate limit | Per-minute limit exceeded |
ts
try {
await client.responses.create({ message: "Hello" });
} catch (error) {
if (error instanceof InceptivaRateLimitError) console.error(error.retryAfter);
else if (error instanceof InceptivaApiError) console.error(error.status, error.detail);
}retryAfter supports both seconds and HTTP dates. SDKs do not retry automatically. Network and cancellation errors remain native to each runtime.
Every API error preserves status, functional code, readable message, and response metadata containing rate-limit and usage headers.
Functional codes
| Category | Codes |
|---|---|
| Authentication | missing_api_key, invalid_api_key, ip_not_allowed |
| Limits | rate_limit_exceeded, rate_limit_unavailable, usage_limit_exceeded |
| Input | message_too_large, metadata_too_large, metadata_too_many_keys, metadata_too_deep, metadata_invalid_key, metadata_invalid_value, metadata_list_too_large |
| Idempotency | idempotency_key_reused, idempotency_request_in_progress |
| Conversation | external_reference_mismatch, conversation_not_found |
| Generation | generation_failed |
· SDKv0.4.0