Cette page est en anglais.
Errors
HTTP status codes, the JSON error body, and the exceptions each Python client raises.
Use strike-ai (s’ouvre dans un nouvel onglet) (pip install strike-ai, from strike_ai import Client).
Error body
Every non-2xx response from the API has one error object:
{
"error": {
"type": "api_error",
"code": "payment_required",
"message": "No credits left. Top up or activate pay as you go.",
"param": null,
"ctx": {"topup_url": "https://strike-ai.eu/account#billing"},
"request_id": "req_8b7781e54519"
}
}type is invalid_request for 422 validation errors and api_error for the rest. ctx is optional extra detail. request_id matches the x-request-id response header. Every response also carries x-strike-api-version.
Branch on the HTTP status and error.code. The message text can change.
Status codes
| Status | code | Meaning |
|---|---|---|
| 400 | invalid_image | The image is missing, too small, or not a PNG or JPEG. See Images. |
| 400 | max_tokens_exceeded | Over 8192 estimated tokens or 32000 characters |
| 401 | authentication_error | Missing or invalid Bearer token |
| 402 | payment_required | The account has paid before and has no credits left, and pay as you go is off |
| 403 | forbidden | Authenticated but not allowed |
| 404 | model_not_found | model names a model this API does not serve |
| 404 | not_found | For example, no retained record for that request_id |
| 409 | key_limit | The account already has 25 active API keys |
| 413 | payload_too_large | Body over 10 MB, a trace batch over 1 MB, more than 4 images, or an image over 4 MiB |
| 422 | validation_error | The request failed schema or engine checks. param names the field. |
| 429 | quota_exceeded | The free 100 decisions per day are used up and the account has never paid |
| 429 | rate_limited | Over the plan's requests per second. Retry-After is set, in seconds. |
| 503 | model_warming | strike-1 is starting or its queue is full. Retry after Retry-After when it is set. |
| 503 | inference_overloaded | The API process is at its in-flight cap. Retry-After: 1 is set. |
| 503 | storage_error | A trace batch could not be stored |
| 529 | engine_unavailable | The engine is not ready |
| 529 | inference_overloaded | Inference failed unexpectedly |
The playground proxy at /api/proxy/... has its own 429 with code too_many_requests. See Rate limits and pricing.
strike-ai exceptions
strike_ai.Client.decide calls raise_for_status(), so any 4xx or 5xx raises httpx.HTTPStatusError. It does not retry.
import httpx
from strike_ai import Client
client = Client()
try:
client.decide("x", {"q": {"type": "noul", "instructions": "Is x a letter?"}})
except httpx.HTTPStatusError as exc:
err = exc.response.json()["error"]
print(exc.response.status_code, err["code"], exc.response.headers.get("retry-after"))
except httpx.TransportError as exc:
print("network error", exc)MCP tool errors
The MCP server (python -m strike_ai.mcp) never fails the agent loop with an exception for a tool call. On failure it returns an isError result so the agent keeps going. A rate-limited call is retried once after the Retry-After the API sends.