Skip to main content
POST
Upload a video for analysis
The Video API accepts a video file, analyzes sampled frames, and returns an asynchronous task ID. Use your API key with the production base URL:

Python SDK

Python SDK 1.1.0 or later supports native video uploads:
The SDK streams the file and polls until completion using the API’s processing defaults. It accepts a path, raw bytes, or a seekable binary file; supply filename="clip.mp4" for bytes or an unnamed stream. For separate submission and progress polling, use submit_video(), get_video_status(), and wait_for_video(). See the SDK reference.

Submit a video file

Send multipart/form-data to POST /v1/video/tasks with one file field. Send your API key in the x-api-key header. The file field is required and must contain one nonempty .mp4, .mov, or .webm file. Unknown or duplicate form fields are rejected. Do not set the multipart Content-Type header yourself: cURL or requests adds the required boundary.

cURL

Python REST

This example calls the REST API directly:
Admission returns HTTP 202:

Poll for the result

Use the same key that submitted the task. Set TASK_ID to the returned task_id before running this cURL example:
Processing stages are STAGE_VIDEO_EXTRACTION, STAGE_VIDEO_INFERENCE, and STAGE_VIDEO_FINALIZING. A task finishes at STAGE_SUCCESS or STAGE_FAILED. Continue from the Python submission example:
During inference, frames_processed and total_frames appear when available. They count sampled frames, rather than elapsed video seconds, and can reset if processing retries.

Successful response

This excerpt shows selected fields from a completed task, including one sampled frame and one timeline segment. Additional frame entries and their segment references are omitted, and the thumbnail’s base64 content is abbreviated:
Segment labels can be human, likely_human, unsure, likely_ai, ai, or mixed. Frame-level image predictions retain their own labels, including Human and AI Detected; do not apply the top-level video enum to frame results.

Response versions

Responses use version 1.1 by default. Existing integrations that require response version 1.0 can add ?response_version=1.0 to the polling URL:
Response format versions are independent of model versions. Response version 1.0 uses Pangram Image Flash 1.0 for the model version and retains its original source fields.

Limits and retention

  • One file per request, up to 500 MiB (524,288,000 bytes).
  • Frame analysis supports up to two minutes for videos at 3 FPS or higher. The API samples 3 frames per second, up to 360 sampled frames. For lower-frame-rate videos, it samples at the source frame rate.
  • The API analyzes the uploaded file; it does not automatically trim long videos. Files exceeding processing limits fail.
  • Completed results are retained for 24 hours. Polling an expired or unknown task returns 404.

Billing

The default video price is USD 0.05 per second, rounded up using the inspected source duration: Only successful tasks are billed. Billing uses the full inspected source duration and your API account balance.

Failures and retries

The polling endpoint returns a failed task with HTTP 200 and stage: "STAGE_FAILED":
Immediate request failures use the same nested error object without a task ID or stage. Submission does not accept an idempotency key. Each new POST creates another task and can incur another charge. Keep the accepted task ID and continue polling after a local timeout instead of uploading the same file again.

Authorizations

x-api-key
string
header
required

Body

multipart/form-data
file
file
required

One nonempty MP4, MOV, or WebM file, up to 500 MiB (524,288,000 bytes).

Response

Successful Response

task_id
string<uuid>
required