File size: 758 Bytes
c34f6d4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | """
Sora 2 Video Generation API Example via NexaAPI
Get your free API key at: https://nexa-api.com
Install: pip install nexaapi
"""
from nexaapi import NexaAPI
# Initialize client - get your key at https://nexa-api.com
client = NexaAPI(api_key='YOUR_API_KEY')
# Generate a short video
video = client.videos.generate(
model='sora-2',
prompt='A timelapse of a blooming flower in a garden, cinematic quality',
duration=5 # seconds
)
print("Sora 2 - Generated Video URL:")
print(video.data[0].url)
# Marketing clip
marketing_video = client.videos.generate(
model='sora-2',
prompt='A robot walking through a neon-lit city at night, futuristic aesthetic',
duration=8
)
print("\nMarketing Video URL:")
print(marketing_video.data[0].url)
|