Veo 3 is now available in the Gemini API

Veo 3 is now available in the Gemini API
Get started with Veo 3

You can now generate high-fidelity, 720p videos with native audio using Veo 3 and Veo 3 Fast, available in paid preview in the Gemini API.
Veo 3 brings your prompts to life, creating 8-second videos with native audio. It lets you generate video from a text prompt, an initial image, or a combination of both to guide the style and starting frame. It can create a wide range of visual styles and natively generate dialogue in multiple languages, as well as sound effects and ambient noise.
Get started in seconds
You can use our SDKs for Python, JavaScript, and Go, or make a direct REST API call with cURL. Get your API key and start generating.
  1. import time
  2. from google import genai

  3. client = genai.Client()

  4. prompt = """A close up of two people staring at a cryptic drawing on a wall, torchlight flickering.
  5. A man murmurs, 'This must be it. That's the secret code.' The woman looks at him and whispering excitedly, 'What did you find?'"""

  6. # Start the generation job
  7. operation = client.models.generate_videos(
  8.     model="veo-3.0-generate-preview",
  9.     prompt=prompt,
  10. )

  11. # Poll for the result
  12. while not operation.done:
  13.     print("Waiting for video generation to complete...")
  14.     time.sleep(10)
  15.     operation = client.operations.get(operation)

  16. # Download the final video
  17. video = operation.response.generated_videos[0]
  18. video.video.save("dialogue_example.mp4")
  19. print("Generated video saved to dialogue_example.mp4")
複製代碼