AI Models Prediction

Run Model Prediction Synchronously

Create a prediction and wait for the result. This compatibility endpoint is only supported for models with synchronous execution enabled; unsupported models return a bad request error.

post/v1/prediction/run

Request

  • Base URL: https://api.eachlabs.ai
  • URL: https://api.eachlabs.ai/v1/prediction/run
  • Auth: HTTP bearer

Request body

modelstring required

Model slug or identifier

fallback_selectorstring

Optional opt-in to an enabled, saved fallback configuration for this organization and primary model. Use the configuration's slug, not a fallback model slug or ID. Set this at the top level of the request, not inside input. Saving a configuration alone does not enable fallback for a request: omitting this field runs only the primary model. Use 1-50 lowercase letters and digits separated by single hyphens.

versionstring

Deprecated. This field is ignored. Kept for backwards compatibility.

inputobject required

Input parameters for the prediction

webhook_urlstring uri

Optional webhook URL to receive prediction result asynchronously

webhook_secretstring

Optional secret used to sign webhook requests

Example request

{
  "model": "flux-1-1-pro",
  "fallback_selector": "quality-recovery",
  "version": "0.0.1",
  "input": {
    "prompt": "A beautiful sunset over the ocean with vibrant colors",
    "aspect_ratio": "16:9"
  },
  "webhook_url": "https://your-app.com/webhook",
  "webhook_secret": "your-secret-key"
}

Response

Prediction completed or failed synchronously

status'success' | 'failed' | 'cancelled'

Final terminal status of the synchronous prediction

messagestring

Human-readable message

predictionIDstring

Unique prediction identifier

errorstring

User-facing error message when the prediction failed

Example response

{
  "status": "success",
  "message": "Prediction completed successfully",
  "predictionID": "abc123-def456-ghi789"
}

Changes

No recorded changes to this operation across all 1 revision of this API.