Create Model Prediction
Create a new prediction for a specific model.
Using a configured model fallback
Saving or enabling a model fallback does not automatically apply it to prediction requests. To opt a prediction into an enabled fallback configuration, include fallback_selector at the top level of the request body, alongside model and input (not inside input). Its value is the saved fallback configuration’s slug, not the fallback model’s slug or ID. The configuration must belong to the API key’s organization and the requested primary model.
For example, if you have saved an enabled configuration with the slug quality-recovery for flux-1-1-pro, send:
{
"model": "flux-1-1-pro",
"fallback_selector": "quality-recovery",
"input": {
"prompt": "A beautiful sunset over the ocean",
"aspect_ratio": "16:9"
}
}
Replace quality-recovery with your saved configuration’s slug, and keep model and input set for the primary model. The saved configuration supplies the fallback models and input mappings. Omit fallback_selector to run only the primary model, even when a fallback configuration exists.
Authorizations
API key passed as Authorization: Bearer <api_key>
Body
Model slug or identifier
"flux-1-1-pro"
Input parameters for the prediction
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.
1 - 50^[a-z0-9]+(?:-[a-z0-9]+)*$"quality-recovery"
Deprecated. This field is ignored. Kept for backwards compatibility.
"0.0.1"
Optional webhook URL to receive prediction result asynchronously
"https://your-app.com/webhook"
Optional secret used to sign webhook requests
"your-secret-key"