Reducing Friction and Delay in Long-Running Tasks with Webhooks in the Gemini API
Key point
The Gemini API has introduced Webhooks for long-running tasks, reducing the burden of polling.
Details
The Gemini API has introduced Webhooks for long-running tasks. In flows that take anywhere from minutes to hours—like Deep Research, long video generation, or processing thousands of prompts with the Batch API—instead of polling with repeated GETs to check status, the server pushes an HTTP POST at the moment of completion.
Reliability and security follow the Standard Webhooks specification. Signing is done via the webhook-signature, webhook-id, and webhook-timestamp headers to guarantee idempotency and prevent replay attacks, and delivery is at-least-once, with automatic retries for up to 24 hours.
There are two configuration options.
- Project-wide settings are protected with HMAC.
- Per-request overrides are protected with JWKS, allowing specific tasks to be sent to a different endpoint.
In the Python SDK example, model=gemini-3-flash-preview, webhook_config, and user_metadata are passed into client.batches.create() to send notifications to https://my-api.com/gemini-webhook-dynamic. The feature is now available to all Gemini API developers, and you can get started right away with the documentation and Cookbook notebooks.
This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.
Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.