Skip to main content

Overview

Webhooks are the push half of Async Inference. Instead of polling GET /v1/async/.../{job_id} until a job reaches a terminal state, register an endpoint once and Bifrost delivers a signed HTTP POST the moment the job completes or fails. Every delivery is signed in the Standard Webhooks format so your receiver can verify it came from your Bifrost instance and was not altered in transit.
Webhooks fire only for async inference jobs. Like Async Inference, this is a gateway-only feature and requires a Logs Store to be configured.
Events:

How It Works

Delivery is at-least-once: a failed attempt is retried with exponential backoff, and every attempt for the same event reuses the same webhook-id. Your receiver must be idempotent — dedupe on webhook-id.

The Delivery Payload

Each delivery is a POST with a JSON body and three signing headers: The body:

Verifying Deliveries

Always verify the signature before trusting a delivery. The signature is HMAC-SHA256 over the exact bytes {webhook-id}.{webhook-timestamp}.{body}, keyed with your endpoint’s signing secret, encoded as v1,<base64>. To verify a delivery:
  1. Recompute and compare. Recompute the HMAC from the secret and the received webhook-id, webhook-timestamp, and raw body, then compare it (in constant time) against every candidate in the webhook-signature header. Accept if any matches — the header can carry more than one signature during secret rotation.
  2. Check the timestamp. Reject deliveries whose webhook-timestamp is outside a tolerance window (5 minutes is a good default) to blunt replay attacks.
  3. Dedupe on webhook-id. Retries reuse the id, so process each id at most once.
The signing secret (whsec_...) is shown once when you create the endpoint. Store it where your receiver can read it, and never hard-code it.
The examples/webhooks receiver is a complete, dependency-free Go implementation of this verification you can copy from — its tests pin the same reference vector Bifrost signs with.

Managing Endpoints

Open Webhooks in the sidebar to see your endpoints and their status.
Webhooks page in the Bifrost Web UI showing a table of endpoints with their name, URL, subscribed events, and enabled status
  1. Select Add Endpoint.
  2. Enter a unique Name and the delivery URL (HTTPS unless the endpoint allows private networks).
  3. Choose the events to subscribe to (async_job.completed, async_job.failed).
  4. Optionally add custom headers (for example an Authorization value your receiver requires) and toggle Include response to inline job responses.
Add Endpoint form in the Bifrost Web UI showing the Name, URL, events selector, custom headers, and Include response fields
  1. Save. The signing secret is shown once in a dialog — copy it now; you cannot retrieve it again.
Signing secret dialog in the Bifrost Web UI showing the one-time whsec_ secret with a copy button and a link to the verification docs
  1. Open an endpoint to view its delivery history, send a Test delivery, or Rotate secret if a secret is ever exposed. Rotation takes effect immediately with no grace window, so update your receiver in the same change.
Endpoint deliveries panel in the Bifrost Web UI showing recent delivery attempts with their status codes alongside the Test and Rotate secret actions

Tuning Deliveries

Each endpoint exposes per-endpoint controls. All are optional and fall back to the defaults below.

Next Steps

  • Async Inference — submit jobs and poll for results; webhooks notify you when those jobs finish.
  • Keys Management — manage the virtual keys used to submit async jobs and fetch results.