Google Veo Integration

Integrate Paygent with Google's GenAI SDK to track video generation with the Veo model.

veo_tracking.py
1import paygent_sdk
2from google import genai
3
4# 1. Initialize Paygent
5paygent_sdk.init(api_key="your-paygent-api-key")
6
7client = genai.Client(api_key="your-gemini-api-key")
8
9# 2. Call Veo - Paygent intercepts and tracks the duration
10operation = client.models.generate_videos(
11    model="veo-3.1-generate-preview",
12    prompt="A space shuttle taking off in a cyberpunk world",
13    config={
14        "duration_seconds": 4
15    },
16    
17    # Paygent tracking parameters
18    paygent_agent_id="veo-agent",
19    paygent_customer_id="user-456",
20    paygent_indicator="video-generation-start"
21)

Polling & Completion

For long-running operations like video generation, Paygent tracks the initiation of the request. Ensure you associate the correct paygent_agent_id to attribute usage correctly.

Was this page helpful?

Need help? Contact us at support@withpaygent.com