/api/ctai endpoint can return errors in two ways:
- Before the stream opens — as an
application/jsonresponse with an HTTP error status code (400, 429, 500). - Inside the stream — as an
errorSSE event with a JSON payload. See SSE Events.
HTTP error responses
400 — Bad request
Returned when the request cannot be processed due to a client error.Missing IoC parameter
Missing IoC parameter
The
ioc query parameter was not provided.Unknown IoC type
Unknown IoC type
The
ioc value does not match any supported format: IPv4, IPv6, domain, MD5, SHA1, or SHA256.429 — Too many requests
Returned when the requesting IP has exceeded the rate limit. See Rate Limiting.| Field | Type | Description |
|---|---|---|
error | string | Always "Too many requests". |
retryAfterSeconds | number | Seconds to wait before the next request will succeed. |
| Header | Description |
|---|---|
Retry-After | Same value as retryAfterSeconds. |
X-RateLimit-Limit | Maximum requests allowed in the window. |
X-RateLimit-Window | Window duration in seconds. |
500 — Internal server error
Returned when an unexpected error occurs before the stream can be opened — for example, when all CTI sources fail critically.Stream error events
Errors that occur after the stream has opened are delivered aserror SSE events instead of an HTTP error status. The stream closes immediately after an error event.
| Field | Type | Description |
|---|---|---|
error | string | Human-readable error message in Spanish. |
stage | string | Pipeline stage where the error occurred. See stages below. |
errorType | string | Machine-readable error classification. See error types below. |
Stage values
Thestage field identifies which part of the analysis pipeline failed.
ioc — threat intelligence gathering
ioc — threat intelligence gathering
The error occurred while fetching data from one or more CTI sources (VirusTotal, AbuseIPDB, PolySwarm, Robtex). The AI analysis was not attempted.Example:
ai — AI analysis
ai — AI analysis
The error occurred while calling OpenRouter or processing the AI model’s response.Example:
unknown — unexpected error
unknown — unexpected error
An error occurred that could not be attributed to a specific stage.
Error type values
TheerrorType field provides a machine-readable classification for programmatic error handling. It appears in both HTTP error response bodies and in error SSE event payloads, as well as in warnings[].reason within meta events.
errorType | Description |
|---|---|
invalid_api_key | The API key for a provider is missing, invalid, or does not have sufficient permissions. |
model_error | The AI model returned an unexpected error — for example, a context length limit was exceeded. |
api_unavailable | The provider’s service is temporarily unavailable (HTTP 5xx from upstream). |
not_found | The IoC was not found in the provider’s records. |
unknown | An unexpected error with no more specific classification. |
Common error bodies
Non-fatal source failures — where some sources succeed and others fail — are reported as
warnings in the meta SSE event rather than as errors. The stream continues and the AI analysis proceeds with data from the available sources.