v1
latestOpenAPI 3.1.02026-07-17122076.0 KBSummarization
Summarize a video file
Run video file summarization. For stream summarization use POST /v1/generate_captions and POST /v1/stream_summarize instead.
post/v1/summarize
Request body
Example request
{
"min_tokens": 100,
"ignore_eos": true,
"url": "https://www.example.com/video.mp4",
"system_prompt": "You are a helpful assistant. Answer the user's question.",
"prompt": "Write a concise and clear dense caption for the provided warehouse video",
"model": "cosmos-reason1",
"max_tokens": 512,
"temperature": 0.2,
"top_p": 1,
"top_k": 100,
"seed": 10,
"chunk_duration": 60,
"chunk_overlap_duration": 10,
"summary_duration": 60,
"media_info": {
"end_offset": 4000000000
},
"num_frames_per_chunk": 10,
"vlm_input_width": 256,
"vlm_input_height": 256,
"enable_audio": true,
"enable_reasoning": true,
"num_frames_per_second_or_fixed_frames_chunk": 1,
"use_fps_for_chunking": true,
"creation_time": "2024-06-09T18:32:11.123Z",
"alert_category": "Worker PPE Violation",
"mm_processor_kwargs": {
"shortest_edge": 384
},
"schema": "{\"type\": \"object\", \"properties\": {\"events\": {\"type\": \"array\"}}}",
"batch_response_method": "json_schema",
"scenario": "warehouse",
"events": [
"fire",
"theft",
"accident"
],
"auto_generate_prompt": true,
"override_vlm_prompt": true,
"enable_vlm_structured_output": true,
"objects_of_interest": [
"person",
"car",
"bicycle"
]
}Response
Successful Response.
Example response
{
"choices": [
{
"index": 1,
"message": {
"content": "Some summary of the video",
"tool_calls": [
{
"alert": {
"ntpTimestamp": "2024-05-30T01:41:25.000Z",
"offset": 20
}
}
]
}
}
],
"created": 1717405636,
"model": "cosmos-reason1",
"media_info": {
"start_timestamp": "2024-05-30T01:41:25.000Z",
"end_timestamp": "2024-05-30T02:14:51.000Z"
},
"usage": {
"query_processing_time": 78,
"total_chunks_processed": 10,
"summary_tokens": 100,
"aggregation_tokens": 100,
"summary_requests": 10,
"summary_latency": 1,
"aggregation_latency": 1
}
}