v22

latestOpenAPI 3.1.0raw.githubusercontent.com2025-10-15361989.5 KB

Cancel a prediction

Cancel a prediction that is currently running.

Example cURL request that creates a prediction and then cancels it:

# First, create a prediction
PREDICTION_ID=$(curl -s -X POST \
  -H "Authorization: Bearer $REPLICATE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "input": {
      "prompt": "a video that may take a while to generate"
    }
  }' \
  https://api.replicate.com/v1/models/minimax/video-01/predictions | jq -r '.id')

# Echo the prediction ID
echo "Created prediction with ID: $PREDICTION_ID"

# Cancel the prediction
curl -s -X POST \
  -H "Authorization: Bearer $REPLICATE_API_TOKEN" \
  https://api.replicate.com/v1/predictions/$PREDICTION_ID/cancel
post/predictions/{prediction_id}/cancel

Path parameters

prediction_idstring required

The ID of the prediction to cancel.

Response

Success

completed_atstring date-time

The time that the model completed the prediction and all outputs were uploaded

created_atstring date-time required

The time that the prediction was created

data_removedboolean required

Whether the prediction output has been deleted

deadlinestring date-time

The absolute time at which the prediction will be automatically canceled if it has not completed

deploymentstring

The name of the deployment that created the prediction

errorstring nullable required

An error string if the model status is "failed"

idstring required
inputobject required

The prediction input

logsstring

The log output from the model

modelstring required

The name of the model that created the prediction

{"stackTrail":"components:schemas:schemas_prediction_response:properties:output","oasType":"schema","type":"unknown","description":"The prediction output, which can be any JSON-serializable value, depending on the model"}
started_atstring date-time

The time that the model began the prediction

status'starting' | 'processing' | 'succeeded' | 'failed' | 'canceled' required