When you create a prediction with the API, you can provide a webhook URL for us to call when your prediction is complete.
Starting today, we now send more webhook events at different stages of the prediction lifecycle. We send requests to your webhook URL whenever there are new logs, new outputs, or the prediction has finished.
You can change which events trigger webhook requests by specifying webhook_events_filter
in the prediction request.
start
: Emitted immediately on prediction start. This event is always sent.output
: Emitted each time a prediction generates an output (note that predictions can generate multiple outputs).logs
: Emitted each time log output is generated by a prediction.completed
: Emitted when the prediction reaches a terminal state (succeeded
/canceled
/failed
). This event is always sent.For example, if you only wanted requests to be sent at the start and end of the prediction, you would provide:
Requests for event types output
and logs
will be sent at most once every 500ms.
Requests for event types start
and completed
will always be sent.
If you're using the old webhook_completed
, you'll still get the same webhooks as before, but we recommend updating to use the new webhook
and webhook_completed
properties.
Docs: https://replicate.com/docs/reference/http#create-prediction--webhook