Errors
HTTP status codes, JSON error bodies, and Python exceptions in strikeflow.
JSON error shape (HTTP API)
Non-2xx responses use a nested error object:
{
"error": {
"type": "api_error",
"code": "authentication_error",
"message": "Invalid API key",
"param": null,
"request_id": ""
}
}type is invalid_request for HTTP 422 validation failures, otherwise usually api_error.
Responses include x-request-id (and x-strike-api-version) headers.
HTTP status codes
| Status | code (typical) | Meaning |
|---|---|---|
| 401 | authentication_error | Missing or invalid Bearer token |
| 404 | (varies) | Resource not found |
| 413 | payload_too_large | Body over limit on the public proxy (see Rate limits) |
| 422 | validation_error | Request failed schema or engine validation |
| 429 | too_many_requests or quota_exceeded | Rate limit or monthly beta quota |
| 503 | model_warming | strike-1 is starting up. Retry after the Retry-After header when present. |
| 529 | engine_unavailable, inference_overloaded | Engine not ready or upstream failure |
| 530 | engine_unavailable | strike-1 is temporarily unreachable. The SDK retries it. |
Proxy-only 429 body example:
{
"error": {
"type": "rate_limit",
"code": "too_many_requests",
"message": "Too many requests. Try again shortly."
}
}Monthly cap (platform keys): HTTP 429 with code quota_exceeded and a message referencing the beta cap.
Python exceptions (strikeflow)
Catch strike.StrikeError for all SDK failures.
| Exception | When |
|---|---|
APIConnectionError | DNS, TLS, connection reset |
APITimeoutError | Request timed out |
AuthenticationError | HTTP 401 or 403 |
RateLimitError | HTTP 429 |
NotFoundError | HTTP 404 |
InternalServerError | HTTP 5xx including 530 |
APIStatusError | Other non-2xx |
APIStatusError exposes status_code, body, and request_id.
Retries
StrikeModel retries 408, 409, 429, 5xx, 530 and connection/timeouts up to max_retries (default 2) with jittered backoff, honouring Retry-After when present.
import strikeflow as strike
strike.configure(max_retries=3, timeout=45.0)Decision tool errors
strike_decision_tool().handle(...) does not raise for decision failures. It returns {"error": "..."} so the host LLM loop can continue.
User-facing copy
The console maps common statuses to short titles in its error catalogue (401, 404, 413, 422, 429, 529, 503 model warming, network). Use those messages in UI; in backend code prefer checking status_code and error.code.