Why webhooks for production
Webhooks are the recommended way to receive execution results in production. Instead of polling (which wastes API calls and is rate-limited), ModelRoute pushes results to your endpoint the moment they’re ready.Setup
1. Register a webhook endpoint
2. Create executions as normal
No changes to your execution requests. ModelRoute automatically delivers webhook events to all active endpoints subscribed to the relevant events.3. Receive events
When an execution completes, ModelRoute sends aPOST to your endpoint:
4. Verify the signature
Always verify the HMAC-SHA256 signature before processing. See webhook verification for code samples in Python, TypeScript, Go, and bash.5. Respond with 200
Return a200 OK to acknowledge receipt. If your endpoint returns a non-2xx status, ModelRoute retries with exponential backoff (up to 5 attempts over 24 hours).
Webhook events
Example: end-to-end flow
Retry policy
If your endpoint is unreachable or returns a non-2xx status:
After 5 failed attempts (or 24 hours), the delivery is marked as failed. You can manually retry failed deliveries via the API.