How to Use Gemini Video Vision
-
Provide a video URL: Host your video at a publicly reachable URL (e.g. an S3 or CDN link) and pass it as video_url.
-
Write a prompt: Describe what you want analyzed — a general description, a structured JSON breakdown, or a specific question about the video's content.
-
Optionally set a system prompt: Use system_prompt to control output format, e.g. "Respond with structured JSON only, no prose."
-
Choose a model: gemini-2.5-flash (default) is fast and cheap; gemini-2.5-pro gives deeper, more accurate analysis for complex videos.
-
Submit and poll: Like all Muapi endpoints, submit the request and poll /predictions/{request_id}/result until status is completed.
Python:
import requests, time
API_KEY = "your_api_key_here"
headers = {"x-api-key": API_KEY, "Content-Type": "application/json"}
r = requests.post("https://api.muapi.ai/api/v1/gemini-video-vision", headers=headers,
json={
"prompt": "Describe the camera movement, subjects, and lighting in this video.",
"video_url": "https://example.com/my-video.mp4"
})
request_id = r.json()["request_id"]
while True:
result = requests.get(f"https://api.muapi.ai/api/v1/predictions/{request_id}/result", headers=headers).json()
if result["status"] == "completed":
print(result["output"]["text"])
break
time.sleep(3)
cURL:
curl -X POST https://api.muapi.ai/api/v1/gemini-video-vision \
-H "x-api-key: YOUR_API_KEY" -H "Content-Type: application/json" \
-d '{"prompt": "Describe this video in detail.", "video_url": "https://example.com/my-video.mp4"}'
Larger videos take longer to process since Gemini uploads and ingests the full file before analysis — expect responses to take anywhere from several seconds to a few minutes depending on video length.