Skip to main content

Endpoint

POST https://api.eachlabs.ai/v1/prediction

Request Body

FieldTypeRequiredDescription
modelstringYesModel slug (e.g., flux-1-1-pro)
versionstringYesModel version (e.g., 1.0.0)
inputobjectYesInput parameters (varies by model)
webhook_urlstringNoURL to receive prediction result via webhook
webhook_secretstringNoSecret used to sign webhook requests
The input object accepts model-specific parameters. Some models also support:
Input FieldTypeDefaultDescription
enable_safety_checkerbooleantrueSet to false to disable NSFW filtering. Only works on supported models.

Code Examples

curl -X POST https://api.eachlabs.ai/v1/prediction \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_API_KEY" \
  -d '{
    "model": "flux-1-1-pro",
    "version": "1.0.0",
    "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

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

Response Fields

FieldTypeDescription
statusstring"success" if prediction was created
messagestringHuman-readable status message
predictionIDstringUnique ID to track the prediction

Error Responses

StatusBodyDescription
400{"error": "Invalid input for model"}Input doesn’t match model schema
400{"error": "model field is required"}Missing required field
401{"error": "Invalid or missing API key"}Authentication failure
500{"error": "Failed to create prediction"}Server error

What Happens Next

After creating a prediction, the model processes your input asynchronously. Here’s how you can get your results:
  1. Poll: Use Get Prediction to check status
  2. Webhook: Provide a webhook_url and get results delivered automatically when they’re ready
Every model has different input parameters. Use Get Model to grab the request_schema for any model and see exactly what it expects.
Last modified on March 6, 2026