import requestsimport jsonimport time# Replace with your Mixpeek API keyAPI_KEY ="YOUR_API_KEY"BASE_URL ="https://api.mixpeek.com"headers ={'Authorization':f'Bearer {API_KEY}','Content-Type':'application/json'}
url =f"{BASE_URL}/index/videos/url"payload = json.dumps({"url":"https://mixpeek-public-demo.s3.us-east-2.amazonaws.com/starter/aussie_agility.mp4","collection_id":"quickstart","metadata":{"hello":"world"},"video_settings":[{"interval_sec":10,"read":{"model_id":"video-descriptor-v1"},"embed":{"model_id":"multimodal-v1"},"transcribe":{"model_id":"polyglot-v1"},"describe":{"model_id":"video-descriptor-v1","prompt":"Create a holistic description of the video, include sounds and screenplay"},"json_output":{"response_shape":{"emotions":["str"]},"prompt":"This is a list of emotion labels, each one should be a string representing the scene."}}]})response = requests.post(url, headers=headers, data=payload)task_id = response.json()['task_id']print(f"Indexing started. Task ID: {task_id}")