Errors

Prediction API Errors

Predictions-only error catalog — routes, `error_id` values, and shapes not repeated on the main API errors page.

Prediction errors

This page is the Predictions supplement to API errors (HTTP semantics, 401429, shared error_id tables, and handling patterns). It lists GET /v1/predictions, POST /v1/predict, POST /v1/predictions, and GET /v1/predictions/:uuid only.

Also read: HTTP status · 401 · 402 · 403 · 404 · 422 · 429 · 500 · 502 · 503

Inference routes use a different shape — Inference errors. JSON field lists — Error objects.


Predictions-only notes

404: MODEL_NOT_FOUND is for a wrong model slug on list/create. GET /v1/predictions/{uuid} does not return 404 for a missing prediction id — use 502 + error_id (Get one).


Error response format

Structured failures use the unified API error envelope (status: false, response, nested error). The response HTTP status matches error.http_status. Branch on error.error_id.

{
  "status": false,
  "response": "Human-readable summary",
  "error": {
    "http_status": 402,
    "message": "Detailed message",
    "details": "String or object",
    "error_id": "ERROR_CODE"
  }
}

Examples: Error objects (VALIDATION_ERROR, 502, 402 credits).


GET /v1/predictions — list

Shared auth errors: 401 (UNAUTHORIZED, ACCOUNT_SUSPENDED).

HTTPerror_idWhat happened
400INVALID_PARAMETERper_page not between 1 and 50
400INVALID_DATE_FORMATfrom or to not Y-m-d
400INVALID_DATE_RANGEfrom after to
400INVALID_PARAMETER_COMBINATIONQuery parameters conflict
404MODEL_NOT_FOUNDmodel query filter slug does not exist
500INTERNAL_ERRORError while paginating

POST /v1/predict / POST /v1/predictions — create

Same handler. Shared codes (VALIDATION_ERROR, MODEL_NOT_SUPPORTED, credits, 403 model gates): 422 · 402 · 403.

Request validation

HTTPerror_idWhat happened
422VALIDATION_ERRORMissing model or input

Examples: missing model · missing input

INVALID_PARAMETER_COMBINATION — 400

Predictions-specific: query or input fields cannot be combined. Fix using error.message / error.details.


Model checks (before modality branch)

HTTPerror_idWhat happened
404MODEL_NOT_FOUNDSlug not found
403MODEL_NOT_ACTIVEModel is not active
403MODEL_NOT_BILLABLEModel has no billable price
422MODEL_NOT_SUPPORTEDModel type is not image, video, or audio

Incompatible parameters (create)

HTTPerror_idWhat happened
400INVALID_PARAMETER_COMBINATIONConflicting input fields

Image predictions

HTTPerror_idWhat happened
402INSUFFICIENT_CREDITSBalance too low — see 402
503PREDICTION_ERROREmpty/invalid handler — see 503
500CREDITS_DEDUCTION_FAILEDDeduction error
502dynamicPrediction Serving Error502 · example

Video / audio predictions

HTTPerror_idWhat happened
403PARAMETER_NOT_ALLOWEDEnterprise-only input
500INPUT_FIELD_MISSINGinput_field not configured
422ASSET_URL_REQUIREDAsset URL missing
422FAILED_TO_CALCULATE_VIDEO_DURATIONDuration from URL failed
422VIDEO_DURATION_LESS_THAN_4_SECONDSBelow minimum duration
402INSUFFICIENT_CREDITSBalance too low
503PREDICTION_ERROREmpty handler
502dynamicPrediction Serving Error
500CREDITS_DEDUCTION_FAILEDDeduction error
500PREDICTION_FAILEDUnexpected result structure

GET /v1/predictions/:uuid — get one

Shared: 401.

HTTPerror_idWhat happened
400PREDICTION_ID_REQUIREDUUID missing from path
502ACCESS_DENIEDPrivate / non-sharable prediction or resource
502dynamicFailed result — error_id from stored/serving outcome
502UNKNOWN_ERRORUnexpected handler result type
500FAILED_TO_FETCH_PREDICTIONException while loading

502 example: Error objects · serving failures: 502

Retry: 500 with backoff. 502: branch on error_idACCESS_DENIED is not retryable; other codes per Prediction Serving Error — 502.


ACCESS_DENIED — 502

Not allowed to use this model, read this prediction, or access this resource (private, non-sharable, or another account). Do not retry until access is valid.


VALIDATION_ERROR — 422

Create body missing model or input. 422 · JSON: validation example


Prediction Serving Error — 502

Serving/runtime failure with 502 and error.error_id. 502 — Bad Gateway · 502 envelope


Prediction-level errors

After the job is accepted, status: "failed" and error on the prediction resource (often 200 on GET) — not the structured error envelope. API errors — prediction level · failed prediction object · prediction.failed webhook

Failed prediction (resource)
{
  "status": "failed",
  "error": "Failed to generate image.",
  "output": null,
  "id": "pred_id....",
  "model": "truefusion"
}

Trailing slash

POST /v1/predictions/ may redirect to GET the list. Use /v1/predictions without a trailing slash.


Handling errors

Use the envelope: read error.error_id on the JSON body (body.error in most clients). Nested shape matches Error objects. General patterns: Handling errors in code.

Predictions envelope (`error` nested)

Python
import os, requests

r = requests.post(
    "https://api.skytells.ai/v1/predictions",
    headers={
        "x-api-key": os.environ["SKYTELLS_API_KEY"],
        "Content-Type": "application/json",
    },
    json={"model": "your-model-slug", "input": {}},
)
data = r.json()
err = data.get("error") or {}
if r.status_code >= 400 and err.get("error_id"):
    print(err["error_id"], err.get("message"))

How is this guide?

On this page