Skip to navigation

OpenAI Sora Integration

Track video generation usage for OpenAI’s Sora model using the Paygent Python SDK.

sora_tracking.py
import paygent_sdk
from openai import OpenAI
# 1. Initialize Paygent
paygent_sdk.init(api_key="your-paygent-api-key")
client = OpenAI()
# 2. Generate video - usage is tracked automatically!
video = client.videos.create(
model="sora-2",
prompt="A cinematic drone shot of a futuristic city",
size="1280x720",
seconds="4",
# Paygent tracking parameters
paygent_agent_id="video-agent",
paygent_customer_id="customer-123",
paygent_indicator="video-created"
)

Automatic Parameter Extraction. Notice that you don’t need to manually send the duration or size to Paygent. The SDK extracts seconds and size directly from the OpenAI call.