VectorMethods

Docs / API reference

Prompt runs

Execute prompts against indexes, selected videos, or playground media, then inspect segment results, failed segments, and media-wide summaries.

api/routes.pysdk/videovector/resources/prompt_runs.pyapi/prompt_run_controllers.py

Search documentation

Search pages, API reference sections, and guide headings.

Summary

Prompt runs are the execution boundary for extraction. The API exposes run creation, status inspection, cancellation, segment results, media-wide synthesis, failed-segment manifests, and debug-oriented LLM call access.

Prompt run endpoints

MethodPathPurpose
POST/api/v2/prompt-runs/executeStart a prompt run
GET/api/v2/prompt-runsList runs
GET/api/v2/prompt-runs/{run_id}Retrieve run status
POST/api/v2/prompt-runs/{run_id}/cancelRequest cancellation
GET/api/v2/prompt-runs/{run_id}/resultsPaginate segment results
GET/api/v2/prompt-runs/{run_id}/videos/{video_id}/video-resultRetrieve media-wide synthesis
GET/api/v2/prompt-runs/{run_id}/failed-segmentsRetrieve failed-segment manifest
POST/api/v2/prompt-runs/{run_id}/videos/{video_id}/segments/{segment_id}/retryRetry one failed segment
GET/api/v2/prompt-runs/{run_id}/videos/{video_id}/segments/{segment_id}/retries/{retry_id}Inspect retry status
GET/api/v2/prompt-runs/{run_id}/llm-callsInspect LLM calls for debugging

Execute request

The public execute request uses:

FieldTypeNotes
prompt_idstringPrompt to execute
targetobjectOne of index, videos, or playground
video_segmentation_typesmart, fixed, or content_awareVideo segmentation mode
audio_segmentation_typefixed or content_awareAudio segmentation mode
video_segment_durationintegerRequired for fixed video segmentation
audio_segment_durationintegerRequired for fixed audio segmentation
processing_modelstringOptional extraction model
enable_transcriptionbooleanEnable speech-to-text
enable_image_embeddingbooleanEnable image-search embeddings

Example: execute against an index

curl -X POST /api/v2/prompt-runs/execute \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: run-archive-2026-04-20" \
  -d '{
    "prompt_id": "prompt_scene_extract",
    "target": {
      "type": "index",
      "index_id": "idx_archive"
    },
    "video_segmentation_type": "smart",
    "audio_segmentation_type": "content_aware",
    "processing_model": "gemini-2.5-flash",
    "enable_transcription": true,
    "enable_image_embedding": true
  }'

Result retrieval

GET /api/v2/prompt-runs/{run_id}/results requires video_id as a query parameter so the response can paginate one media item's segment-level records at a time.

curl "/api/v2/prompt-runs/run_123/results?video_id=vid_456&limit=50" \
  -H "X-API-Key: sk_live_..."

Failure handling

Use the failed-segment manifest before retrying:

  1. Retrieve /failed-segments.
  2. Inspect the failed operation counts and retryability.
  3. Retry only the affected segment.
  4. Poll the retry status endpoint until terminal.

Cancellation

Cancellation is cooperative. The stop request is stored on the run, and work already in progress may still finish before the run reaches a terminal state.

Estimate endpoint

The platform also exposes POST /api/v2/prompt-runs/estimate with the same request shape as execution. It is useful for dry-run validation before execution, but billing interpretation is intentionally out of scope for this documentation set.

SDK equivalents

  • client.prompt_runs.execute
  • client.prompt_runs.retrieve
  • client.prompt_runs.list_results
  • client.prompt_runs.get_video_result
  • client.prompt_runs.get_failed_segments
  • client.prompt_runs.retry_segment
  • client.prompt_runs.get_segment_retry_status

Related documentation

A prompt run applies one prompt to one target with explicit execution settings. Segment-level extraction and video-level synthesis are related but distinct stages.

This guide shows how to execute prompt runs against indexes, selected media items, and playground content, then inspect state and results.

The search API combines semantic retrieval, exact metadata filtering, cross-run search, playground search, and analyst-style SQL execution on run-backed tables.