Docs / Agentic examples

Agentic examples

Example prompts for driving open-videocore from an AI agent — send a large file for review, build a highlights collection, get notified on completion — with the real API calls each one makes.

open-videocore is a plain REST API with a committed openapi.json — that's enough for a general-purpose AI coding agent (Claude Code, or any assistant you've given API access to) to drive it directly from a natural-language prompt. No bespoke SDK, plugin, or custom tool required: point the agent at the guides or the raw endpoints and describe the outcome you want.

If your agent is already connected to OSC (for example over the OSC MCP server), you don't need to tell it your instance URL or hand it a token at all — it can look up your open-videocore My App itself and dispatch the call through OSC's MCP layer, which authenticates it automatically. The agent never sees or handles a bearer token. Just name the instance, or skip that too if you only have one.

Otherwise, give it your instance URL (https://<your-instance>) and bearer token the same way you'd hand any other API credential to an assistant — as an environment variable, a secret store, or pasted into the conversation.

Scenario: you have a large video file on your own machine and need someone else to review it, without emailing a multi-gigabyte attachment or waiting on a slow file-sharing upload.

Prompt
I have a 4.2 GB video file at ~/Desktop/keynote-final.mp4 that Jana needs
to review by Friday. Upload it to my open-videocore instance, wait until
it's ready, package it for streaming, and give me a playback link I can
send her.

What the agent does, mapped to the real calls:

  1. POST /api/v1/assets/ — create the asset record
  2. Because the file is large, a multipart upload: POST /api/v1/assets/{id}/multipart/initiateGET /api/v1/assets/{id}/multipart/{uploadId}/part-url — per part → POST /api/v1/assets/{id}/multipart/{uploadId}/complete
  3. Poll GET /api/v1/assets/{id} until status leaves uploading
  4. POST /api/v1/assets/{id}/execute — run the transcode-and-package pipeline (see Transcoding & packaging), then poll the execution
  5. GET /api/v1/assets/{id}/delivery for the playback URL (see Delivery & playback)

If the agent also has messaging tools connected, the same prompt can end with "...and send Jana a Slack message with the link" — the video handling is exactly the same either way.

Build a highlights collection from tagged clips

Scenario: pull every clip that matches a tag into one collection for an editor, without hand-searching the library.

Prompt
Find all assets tagged "goal" from this week's match footage on my
open-videocore instance and put them in a new collection called
"Matchday highlights" for the editing team.

What the agent does:

  1. GET /api/v1/search — filter by tags=goal, see Metadata, tags & search (guide)
  2. POST /api/v1/collections/ — create "Matchday highlights"
  3. PUT /api/v1/collections/{id}/assets/{assetId} — once per matching asset (see Organizing: collections & webhooks)

Get notified when uploads finish processing

Scenario: stop manually checking whether ingested files have finished processing.

Prompt
Turn on watch-folder ingest for the "raw-uploads" bucket on my
open-videocore instance, and register a webhook so we get pinged whenever
an asset finishes processing or fails.

What the agent does:

  1. POST /api/v1/storage/buckets/{bucket}/watch-folder/toggle — {"enabled": true} (see Ingesting media)
  2. POST /api/v1/webhooks/ — events: ["asset.ready", "asset.failed"] (see Organizing: collections & webhooks)