v1

latestOpenAPI 3.1.02026-07-17122076.0 KB
Stream

Summarize a stream

Aggregate existing captions for a stream from the database via CA-RAG and return a structured summary. The stream must have been previously started with /v1/generate_captions.

post/v1/stream_summarize

Request body

idstring uuid required

Stream ID to summarize.

modelstring required

Model identifier (must match the loaded model).

start_timenumber nullable

Time window start for summarization (seconds, 0 = no filter).

end_timenumber nullable

Time window end for summarization (seconds, 0 = no filter).

enable_vlm_structured_outputboolean

Enable structured VLM output for summarization.

camera_idstring nullable

Camera / sensor identifier.

summarize_max_tokensinteger nullable

Max tokens for LLM aggregation.

summarize_temperaturenumber nullable

Temperature for LLM aggregation.

summarize_top_pnumber nullable

Top-p for LLM aggregation.

summarize_batch_sizeinteger nullable

Batch size for summarization.

schemastring nullable

Schema for unstructured output format.

batch_response_methodstring nullable

Batch response method for summarization.

auto_generate_promptboolean nullable

Auto-generate summarization prompt from scenario/events.

time_metadata_keysstring[] nullable

Time metadata keys for summarization.

collection_namestring nullable

External collection name for DB storage.

custom_metadataobject nullable

Custom metadata for DB storage.

delete_external_collectionboolean

Delete external collection after summarization.

Example request

{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "model": "cosmos-reason1",
  "camera_id": "camera_1"
}

Response

Successful Response.

idstring uuid required

Unique ID for the query

video_idstring uuid required

Unique ID for the video

createdinteger required

The Unix timestamp (in seconds) of when the chat completion/summary request was created.

modelstring required

The model used for the chat completion/summarization.

object'chat.completion' | 'summarization.completion' | 'summarization.progressing' | 'vlm_captions.completion' | 'vlm_captions.progressing' required

Completion object type.

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
  }
}