Errors and Rate Limits
Apira returns structured JSON errors so agents can decide whether to revise the request, retry later, or stop and ask for operator action.
Error envelope
Errors use this shape:
{
"error": {
"code": "VALIDATION_ERROR",
"message": "query is required",
"status": 400
}
}Validation errors may also include a details array with field-level information.
Common status codes
| Status | Code | Meaning | Agent behavior |
|---|---|---|---|
400 | VALIDATION_ERROR | Request body or parameters failed validation. | Revise the tool arguments before retrying. |
401 | AUTH_ERROR | The API key is missing or invalid. | Stop and ask the operator to configure a valid key. |
403 | FORBIDDEN | The authenticated user is not allowed to perform the request. | Stop retrying; report the permission issue. |
404 | NOT_FOUND | The requested resource does not exist. | Check the endpoint or URL. |
429 | RATE_LIMIT_EXCEEDED or DAILY_SEARCH_LIMIT_EXCEEDED | The request exceeded a minute limit or the account's daily beta allowance. | Back off until Retry-After; preserve task state. |
500 | INTERNAL_ERROR | An unexpected server error occurred. | Retry with jitter if the user task can wait, otherwise degrade gracefully. |
502 | EXTERNAL_SERVICE_ERROR | An upstream service failed. | Retry with jitter or explain the upstream failure. |
503 | RATE_LIMIT_UNAVAILABLE or SEARCH_PAUSED | Admission is unavailable or public search is temporarily paused. | Retry later; do not spin in a tight loop. |
Rate limits
During the free public beta, search requires signup and an API key and costs nothing; no credit card is required. Public limits are:
- Up to
50admitted searches per account per UTC day, shared across its API keys. 30requests per minute per IP, applied globally before authentication.60requests per minute per authenticated user/account for search traffic.- Service-wide capacity limits.
A search counts toward the daily allowance only after authentication, schema validation, and minute limits pass. It remains counted if later provider work fails. Invalid and minute-limited requests do not consume the daily allowance. Beta limits and availability may change, and Apira may temporarily pause or discontinue the service.
429 RATE_LIMIT_EXCEEDED responses include:
X-RateLimit-Limit: the limit for the current window.X-RateLimit-Remaining: remaining requests in the current window.X-RateLimit-Reset: Unix timestamp when the current window resets.Retry-After: seconds to wait before retrying.
503 RATE_LIMIT_UNAVAILABLE responses are limiter-backend failures and may include only Retry-After.
Agent retry guidance
Agents should retry only when the error is likely transient:
- Retry
429,500,502, and503with backoff and a maximum attempt count. - Do not retry
400without changing the request. - Do not retry
401or403; these need operator or account action. - Preserve the user's task state so the agent can resume after waiting.
- Disclose degraded results if the agent falls back to a broader search, cached candidates, or no Apira call.
For exact status codes and schemas, use the OpenAPI JSON.