͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏ ͏
Event-driven webhooks are are now in Gemini API
|
|
|
|
|
Tired of polling for job status? Gemini API now supports webhooks to provide real-time HTTP POST notifications that hit your server the moment a batch job completes, a video finishes generating, or an agent workflow needs attention.
Why webhooks
- Real-time alerts: Get notified the moment your massive batch or long video generation task is done.
- Secure & reliable: Built on the Standard Webhooks specification, featuring signed requests and guaranteed "at-least-once" delivery with backoff.
- Flexible setup: Supports both static (project-level) and dynamic (per-request) webhook registration.
|
|
|
|
|
All you need is an HTTPS endpoint that can receive POST requests and your Gemini API key. Here's a quick example of how you can dynamically configure a webhook for a Gemini batch job using the Python SDK:
|
|
|
from google import genai
from google.genai import types
client = genai.Client()
webhook_config = types.WebhookConfig(
uri="https://your-server.com/webhooks/gemini",
subscribed_events=["video.generated"]
)
operation = client.models.generate_videos(
model="veo-3.1-generate-preview",
prompt="A stunning drone view of the Grand Canyon.",
config={"webhook_config": webhook_config}
)
print(f"Video generation job {operation.name} started! You'll be notified at your webhook URI.")
|
|
|
|
|
|
Full event catalog and tips for how to secure your endpoints.
|
|
|
|
|
A cookbook for building end-to-end webhook integrations.
|
|
|
|
|
|
|
The Google AI Studio team
|
|
|
|
|
This email was sent to pudding.archive.20221204@gmail.com because you signed up to receive emails about Google AI. If you do not wish to receive these emails, please unsubscribe.
|
|
|