Skip to main content

Goal

Validate a stream, run one synchronous check, then start async monitoring and read job status.

Prerequisites

Step 1: Validate Stream Liveness

curl -X POST https://trio.machinefi.com/api/streams/validate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"stream_url":"https://www.youtube.com/watch?v=jfKfPfyJRdk"}'
If this fails, resolve URL issues first before starting jobs.

Step 2: Run One Immediate Check

curl -X POST https://trio.machinefi.com/api/check-once \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stream_url":"https://www.youtube.com/watch?v=jfKfPfyJRdk",
    "condition":"Is there an animated character visible?"
  }'
The response includes:
  • triggered: boolean
  • explanation: model explanation
  • latency_ms: request latency

Step 3: Start Continuous Monitoring

curl -X POST https://trio.machinefi.com/api/live-monitor \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "stream_url":"https://www.youtube.com/watch?v=jfKfPfyJRdk",
    "condition":"Is there a cat visible?"
  }'
You receive a job_id and status.

Step 4: Poll Job Status

curl https://trio.machinefi.com/api/jobs/YOUR_JOB_ID \
  -H "Authorization: Bearer YOUR_API_KEY"
Terminal statuses are completed, stopped, and failed.

Step 5: Stop Early (Optional)

curl -X DELETE https://trio.machinefi.com/api/jobs/YOUR_JOB_ID \
  -H "Authorization: Bearer YOUR_API_KEY"

What You Just Completed

  • Pre-flight URL validation
  • One synchronous condition check
  • One async monitoring job
  • Job lifecycle tracking via /jobs/{job_id}

Next Steps