Kryyt / Developers

Errors & Recovery

Read both the HTTP status and error code before deciding to retry.

Status and error codes

Status / codeMeaningAction
400 / invalid_jsonJSON cannot be parsedSend a valid JSON object and Content-Type header.
400 / missing_required_parameterMissing model, messages, or promptCorrect the named parameter.
400 / invalid_value, unsupported_valueInvalid roles/content, or n other than 1Correct the request before retrying.
400 / vision_not_supportedModel does not accept image inputChoose an available vision-enabled model or remove images.
401 / invalid_api_keyMissing, invalid, revoked key, or inactive projectCheck your project key; do not retry unchanged.
404 / model_not_foundModel is not availableQuery /v1/models with the same key.
413Request too largeReduce image/body size. A proxy may return HTML rather than JSON.
429 / insufficient_creditsAvailable purchased balance cannot cover the estimated requestRecharge or lower the requested output budget; waiting alone does not fix it.
429 / gateway rate limitTraffic throttled by the gatewayUse bounded exponential backoff and honor Retry-After if present.
502 / upstream_errorModel request failedInspect the error; retry transient failures cautiously.
500 / internal_errorUnexpected gateway failureRetain X-Request-ID for support; avoid unlimited retries.

Error body

Insufficient credits
{
  "error": {
    "message": "Recharge Kryyt credits to continue",
    "type": "insufficient_quota",
    "param": null,
    "code": "insufficient_credits"
  }
}

Gateway-generated validation and funding errors use this shape. A reverse proxy or infrastructure failure may return a different body; check status and Content-Type before parsing JSON.

Retry policy

Do not retry invalid keys, bad input, unavailable models, oversized bodies, or insufficient credits unchanged. For transient failures, use a small retry budget with backoff and jitter. A timeout can occur after generation began, so a retry may duplicate output and usage. This gateway does not provide an idempotency guarantee for completions.

Examples disable the SDK's automatic retries so your application can distinguish funding errors from traffic throttling. See stream interruptions before retrying a partial answer.

Diagnostics

Retain the response X-Request-ID, status, error code, and a timestamp. Do not log API keys, sensitive prompts, or image data URLs. The status page is informational and is not a guarantee that every dependency is operational.