Saltar para o conteúdo principal
StrikeStrike
API

As descrições dos endpoints são geradas a partir do OpenAPI em inglês. Erros.

Errors

Use strike-ai (abre num novo separador) (pip install strike-ai, from strike_ai import Client).

Error body

Every non-2xx response from the API has one error object:

JSON
{
  "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

StatuscodeMeaning
400invalid_imageThe image is missing, too small, or not a PNG or JPEG. See Images.
400max_tokens_exceededOver 8192 estimated tokens or 32000 characters
401authentication_errorMissing or invalid Bearer token
402payment_requiredThe account has paid before and has no credits left, and pay as you go is off
403forbiddenAuthenticated but not allowed
404model_not_foundmodel names a model this API does not serve
404not_foundFor example, no retained record for that request_id
409key_limitThe account already has 25 active API keys
413payload_too_largeBody over 10 MB, a trace batch over 1 MB, more than 4 images, or an image over 4 MiB
422validation_errorThe request failed schema or engine checks. param names the field.
429quota_exceededThe free 100 decisions per day are used up and the account has never paid
429rate_limitedOver the plan's requests per second. Retry-After is set, in seconds.
503model_warmingstrike-1 is starting or its queue is full. Retry after Retry-After when it is set.
503inference_overloadedThe API process is at its in-flight cap. Retry-After: 1 is set.
503storage_errorA trace batch could not be stored
529engine_unavailableThe engine is not ready
529inference_overloadedInference 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.

Python
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.

Strike AI | Erros