Skip to main content
POST
/
check-once
Check Once
curl --request POST \
  --url https://trio.machinefi.com/api/check-once \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "stream_url": "<string>",
  "condition": "<string>",
  "include_frame": false,
  "input_mode": "frames",
  "clip_duration_seconds": 3
}
'
{
  "triggered": true,
  "explanation": "<string>",
  "latency_ms": 123,
  "frame_b64": "<string>"
}
Runs one immediate condition check and returns a single result. Use this when you need a fast yes/no answer now, or when validating a condition before long-running jobs.

How It Differs From Async Jobs

  • POST /check-once is synchronous and returns one result.
  • POST /live-monitor creates/streams a monitoring job.
  • POST /live-digest creates/streams summary windows.

Suggested Flow

  1. Validate stream liveness: Validate Stream
  2. Test condition wording: POST /check-once
  3. Move to monitor/digest only when wording is reliable.

Response Semantics

The response is immediate and includes:
  • triggered: boolean decision
  • explanation: human-readable reason tied to visible evidence
  • latency_ms: end-to-end request latency
  • frame_b64: optional frame payload when requested
Client handling recommendation:
  • if triggered = true, execute your success path
  • if triggered = false, refine condition or continue monitoring workflow

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request for a single synchronous check.

stream_url
string
required

YouTube Live URL or RTSP stream

Required string length: 1 - 500
condition
string
required

Condition to check

Required string length: 1 - 1000
include_frame
boolean
default:false

Include base64 frame in response

input_mode
enum<string>
default:frames

Input mode: 'frames' for single frame, 'clip' for video clip, 'hybrid' for frame+clip combined

Available options:
frames,
clip,
hybrid
clip_duration_seconds
integer
default:3

Duration of video clip in seconds (used when input_mode is 'clip' or 'hybrid')

Required range: 1 <= x <= 10

Response

Successful Response

Response for a single check.

triggered
boolean
required
explanation
string
required
latency_ms
integer
required
frame_b64
string | null