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
}
'import requests
url = "https://trio.machinefi.com/api/check-once"
payload = {
"stream_url": "<string>",
"condition": "<string>",
"include_frame": False,
"input_mode": "frames",
"clip_duration_seconds": 3
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stream_url: '<string>',
condition: '<string>',
include_frame: false,
input_mode: 'frames',
clip_duration_seconds: 3
})
};
fetch('https://trio.machinefi.com/api/check-once', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://trio.machinefi.com/api/check-once",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'stream_url' => '<string>',
'condition' => '<string>',
'include_frame' => false,
'input_mode' => 'frames',
'clip_duration_seconds' => 3
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://trio.machinefi.com/api/check-once"
payload := strings.NewReader("{\n \"stream_url\": \"<string>\",\n \"condition\": \"<string>\",\n \"include_frame\": false,\n \"input_mode\": \"frames\",\n \"clip_duration_seconds\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://trio.machinefi.com/api/check-once")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stream_url\": \"<string>\",\n \"condition\": \"<string>\",\n \"include_frame\": false,\n \"input_mode\": \"frames\",\n \"clip_duration_seconds\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trio.machinefi.com/api/check-once")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stream_url\": \"<string>\",\n \"condition\": \"<string>\",\n \"include_frame\": false,\n \"input_mode\": \"frames\",\n \"clip_duration_seconds\": 3\n}"
response = http.request(request)
puts response.read_body{
"triggered": true,
"explanation": "<string>",
"latency_ms": 123,
"frame_b64": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"remediation": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"remediation": "<string>"
}
}Monitoring
Check Once
Perform a single synchronous condition check on a YouTube Live stream
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
}
'import requests
url = "https://trio.machinefi.com/api/check-once"
payload = {
"stream_url": "<string>",
"condition": "<string>",
"include_frame": False,
"input_mode": "frames",
"clip_duration_seconds": 3
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
stream_url: '<string>',
condition: '<string>',
include_frame: false,
input_mode: 'frames',
clip_duration_seconds: 3
})
};
fetch('https://trio.machinefi.com/api/check-once', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://trio.machinefi.com/api/check-once",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'stream_url' => '<string>',
'condition' => '<string>',
'include_frame' => false,
'input_mode' => 'frames',
'clip_duration_seconds' => 3
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://trio.machinefi.com/api/check-once"
payload := strings.NewReader("{\n \"stream_url\": \"<string>\",\n \"condition\": \"<string>\",\n \"include_frame\": false,\n \"input_mode\": \"frames\",\n \"clip_duration_seconds\": 3\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://trio.machinefi.com/api/check-once")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"stream_url\": \"<string>\",\n \"condition\": \"<string>\",\n \"include_frame\": false,\n \"input_mode\": \"frames\",\n \"clip_duration_seconds\": 3\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://trio.machinefi.com/api/check-once")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"stream_url\": \"<string>\",\n \"condition\": \"<string>\",\n \"include_frame\": false,\n \"input_mode\": \"frames\",\n \"clip_duration_seconds\": 3\n}"
response = http.request(request)
puts response.read_body{
"triggered": true,
"explanation": "<string>",
"latency_ms": 123,
"frame_b64": "<string>"
}{
"error": {
"code": "<string>",
"message": "<string>",
"remediation": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"remediation": "<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-onceis synchronous and returns one result.POST /live-monitorcreates/streams a monitoring job.POST /live-digestcreates/streams summary windows.
Suggested Flow
- Validate stream liveness: Validate Stream
- Test condition wording:
POST /check-once - Move to monitor/digest only when wording is reliable.
Response Semantics
The response is immediate and includes:triggered: boolean decisionexplanation: human-readable reason tied to visible evidencelatency_ms: end-to-end request latencyframe_b64: optional frame payload when requested
- if
triggered = true, execute your success path - if
triggered = false, refine condition or continue monitoring workflow
Related
- Workflow selection: Choose Your Workflow
- Condition quality: Writing Reliable Conditions
- Continuous detection: Live Monitor
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Request for a single synchronous check.
YouTube Live URL or RTSP stream
Required string length:
1 - 500Condition to check
Required string length:
1 - 1000Include base64 frame in response
Input mode: 'frames' for single frame, 'clip' for video clip, 'hybrid' for frame+clip combined
Available options:
frames, clip, hybrid Duration of video clip in seconds (used when input_mode is 'clip' or 'hybrid')
Required range:
1 <= x <= 10