Overview
Instead of polling for task status, configure a webhook to receive notifications when events occur. ModelHunter.AI will POST a JSON payload to your URL.Register a Webhook
Event Types
| Event | Description |
|---|---|
task.completed | A generation task finished successfully |
task.failed | A generation task failed |
Webhook Payload
Headers
Body
Per-Job Webhooks vs Configured Webhooks
There are two types of webhook delivery:- Configured webhooks (registered via
POST /api/v1/webhooks) includeX-Webhook-Signaturefor verification and support automatic retries. - Per-job webhooks (via
webhookUrlin a generation request) do not includeX-Webhook-Signature(no shared secret), but include additional headers:X-Webhook-Event(e.g.task.completed) andX-Job-ID.
Signature Verification
Configured webhooks include anX-Webhook-Signature header. Verify it to ensure the request is authentic.
The signature is computed as HMAC-SHA256(timestamp + "." + body, secret).
Retry Policy
If your endpoint does not return a2xx status, ModelHunter.AI retries with exponential backoff:
| Attempt | Delay |
|---|---|
| 1 | 1 minute |
| 2 | 5 minutes |
| 3 | 30 minutes |