Inbound webhooks (Replicate)
How Hypery verifies Replicate prediction webhooks and required environment variables
Summary
When you use Replicate through Hypery with REPLICATE_WEBHOOK_URL pointing at this deployment, Replicate sends completion events to POST /api/webhooks/replicate. The gateway verifies each request using Replicate’s signing secret (whsec_...) per Replicate webhook verification, then finalizes billing idempotently.
Endpoint
Input (HTTP)
Replicate sends a JSON body (prediction id, status, metrics, etc.). Verification uses these headers (do not strip or rewrite the raw body before verifying):
webhook-idwebhook-timestampwebhook-signature(space-delimitedv1,<base64>entries)
Output (JSON)
Example success:
{
"received": true,
"predictionId": "abc123",
"status": "succeeded",
"charged": true
}Duplicate delivery (same webhook-id):
{
"received": true,
"duplicate": true,
"predictionId": "abc123"
}Environment variables
# From Replicate: GET https://api.replicate.com/v1/webhooks/default/secret
export REPLICATE_WEBHOOK_SECRET="whsec_..."Related operator variables (admin / cron)
These protect model sync and migration routes (not public API keys):
Code examples (verifying manually)
# Health check only — will fail signature without real Replicate headers
curl -sS -X POST "https://YOUR_DEPLOYMENT/api/webhooks/replicate" \
-H "Content-Type: application/json" \
-d '{"id":"test"}'Real traffic must come from Replicate with valid webhook-signature headers.