Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
Skip to Content
API ReferenceComputeWebhooks

Async job events

Sent once per async job when it ends, usually within a minute, to each enabled webhook that lists the event, with the job and its results. The events are async.job.completed, async.job.cancelled and async.job.failed. A job whose deadline passed ends completed, with its unstarted requests counted expired, so there is no expired event. The body carries the job as GET /v1/async/jobs/{id} answers for it. When the job's results total 256 KiB or less and the create rejected no line, the body carries them in data.results and data.results_url is null; otherwise data.results is null and data.results_url is the job's results pages. A failed delivery is retried 7 times, after 10 seconds, 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 15 hours, the last about 23.6 hours after the first. Listing an async job event needs batch read access.

Header Parameters

X-OpenRelay-Signature*string

sha256= followed by the lowercase hex HMAC-SHA256 of the raw request body. The HMAC key is the 64 character lowercase hex SHA-256 of your whole whsec_ secret, prefix included, used as those characters rather than decoded from hex. Verify it over the exact bytes received, before parsing them. Only the body is signed: there is no timestamp. The signing secret is read at each attempt, so a retry after a regenerate is signed with the new secret.

Match^sha256=[0-9a-f]{64}$
X-OpenRelay-Event*string

The event's type, the same as the body's type.

X-OpenRelay-Delivery*string

The id of this delivery to this webhook, a UUID. Every retry of the delivery carries the same id and the same body, so deduplicate on it.

Formatuuid
User-Agent*"OpenRelay-Webhook/1.0"
Value in"OpenRelay-Webhook/1.0"
X-VectorLay-Signature*stringDeprecated

The same value as X-OpenRelay-Signature, under the name used before OpenRelay. Deprecated, to be removed in a future release: verify X-OpenRelay-Signature.

Match^sha256=[0-9a-f]{64}$
X-VectorLay-Event*stringDeprecated

The same value as X-OpenRelay-Event. Deprecated, to be removed in a future release: read X-OpenRelay-Event.

X-VectorLay-Delivery*stringDeprecated

The same value as X-OpenRelay-Delivery. Deprecated, to be removed in a future release: read X-OpenRelay-Delivery.

Formatuuid

Request Body

application/json
  1. body

The body of an async.job.completed, async.job.cancelled or async.job.failed delivery: the job's final state. A job whose deadline passed ends completed, with its unstarted requests counted expired, so there is no expired event.

id*string

The event's id, evt_ followed by a UUID derived from the event type and the job id, so a job's event always has the same id.

type*string
Value in"async.job.completed""async.job.cancelled""async.job.failed"
created_at*string

When the job ended, RFC 3339 in UTC to the second.

Formatdate-time
data*

Response Body

Delivered. Any 2xx status within 10 seconds counts, and its body is not kept.

Example Requests
POST/asyncEvent

The body of an async.job.completed, async.job.cancelled or async.job.failed delivery: the job's final state. A job whose deadline passed ends completed, with its unstarted requests counted expired, so there is no expired event.

Request Body
application/json
{  "id": "evt_…",  "type": "async.job.completed",  "created_at": "2026-11-04T12:00:00Z",  "data": {    "job": {      "id": "ajob_…",      "object": "async.job",      "completion_window": "1h",      "status": "completed",      "created_at": 1793793600,      "started_at": 1793793610,      "completed_at": 1793793700,      "deadline_at": 1793797200,      "request_counts": {        "total": 1,        "completed": 1,        "failed": 0,        "expired": 0,        "cancelled": 0      },      "usage": {        "input_tokens": 12,        "cached_input_tokens": 0,        "output_tokens": 20      },      "cost_nano_usd": 44610,      "input_file_id": "file-…",      "output_file_id": "file-…",      "error_file_id": null,      "metadata": {}    },    "results": null,    "results_url": "https://inference.openrelay.inc/v1/async/jobs/ajob_…/results"  }}
Header Parameters
{  "X-OpenRelay-Signature": "string",  "X-OpenRelay-Event": "string",  "X-OpenRelay-Delivery": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "User-Agent": "OpenRelay-Webhook/1.0",  "X-VectorLay-Signature": "string",  "X-VectorLay-Event": "string",  "X-VectorLay-Delivery": "497f6eca-6276-4993-bfeb-53cbbbba6f08"}