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