Infra & cost

Webhook

An HTTP callback an AI service makes to your endpoint when a long-running event completes — async results, agent updates, batch jobs.

01 ——

In plain English

A webhook is a URL the AI service POSTs to when something interesting happens — usually because the work is too long to wait for in a single HTTP request. You hand the provider your endpoint at job-start; they call you back when the job is done.

Why AI APIs need them:

  • Long-running generation — video, image batches, fine-tuning jobs, deep-research agents
  • Streaming alternative — you can stream responses, but webhooks are better for "fire and forget" use cases
  • Batch processing — Anthropic Message Batches, OpenAI Batch API return via webhook or polling
  • Agent events — long-running agent runs push progress updates as webhook events

Common patterns:

  • Single completion callback — one POST when the job is done
  • Streaming events — multiple POSTs as the agent makes progress
  • Signed payloads — providers sign requests so you can verify they're real

Securing them: Validate the signature header (every major provider supports it). Otherwise anyone who guesses your URL can POST fake events.

02 ——

Related terms

Back to glossaryLast reviewed May 2026
Vol. 4 · Issue 19 · Last reviewed 2026-05-30

Sign up for our newsletter

Receive weekly updates so you can stay up-to-date with the world of AI