Trio Vision — Turn Any Camera Into a Smart Camera
Stop getting dumb motion alerts for every shadow. Describe what actually matters in plain English — get notified only when it happens, right in your chat. Powered by Trio by MachineFi.
When to Use
- - User asks what's happening on a camera, stream, or video feed ("is anyone at my front door?")
- User wants smart alerts for specific events ("tell me when a package is delivered", "alert me if my dog gets on the couch")
- User wants to monitor something they can't watch themselves (construction site, parking spot, warehouse)
- User wants periodic summaries of a live feed ("summarize this stream every 10 minutes")
- User provides any live stream URL: YouTube Live, Twitch, RTSP/RTSPS cameras, HLS streams
Prerequisites
- - A Trio API key. Get one free (100 credits) at https://console.machinefi.com
- Set the key: INLINECODE0
- Base URL: INLINECODE1
Available Actions
1. Check Once (Quick Snapshot)
Ask a yes/no question about what's currently visible on a stream. Costs 1 credit ($0.01).
CODEBLOCK0
Optional parameters:
- -
"include_frame": true — returns the analyzed frame as base64 image - INLINECODE3 — analyze a short video clip instead of a single frame (better for motion detection)
- INLINECODE4 — clip length (1-10 seconds, only with clip/hybrid mode)
Response fields:
- -
triggered (boolean) — whether the condition matched - INLINECODE6 (string) — VLM's reasoning about what it sees
- INLINECODE7 — processing time in milliseconds
Input mode guidance:
- - Use
"frames" (default) for static objects: "Is there a car in the driveway?", "Is the door open?" - Use
"clip" for motion/actions: "Is someone walking?", "Did a package get delivered?" - Use
"hybrid" for maximum accuracy (costs more)
2. Live Monitor (Continuous Event Detection)
Monitor a stream continuously and get alerted when a condition becomes true. Costs 2 credits/min ($0.02/min).
CODEBLOCK1
Optional parameters:
- -
"webhook_url": "https://your-server.com/webhook" — receive HTTP POST notifications on trigger - INLINECODE12 — check frequency (5-300 seconds)
- INLINECODE13 — how long to monitor (min 5 seconds)
- INLINECODE14 — minimum seconds between triggers
- INLINECODE15 — set to null for unlimited triggers
- INLINECODE16 — default for live-monitor, good for motion
Response: Returns a job_id. Use it to check status or cancel.
Delivery modes (automatic based on request):
- - If
webhook_url is set → events POST to your webhook - If
Accept: text/event-stream header is set (no webhook) → SSE stream - Otherwise → poll with INLINECODE20
3. Live Digest (Periodic Summaries)
Get narrative summaries of what's happening on a stream at regular intervals. Costs 2 credits/min ($0.02/min).
CODEBLOCK2
Optional parameters:
- -
"window_minutes": 10 — summary window length (1-60 minutes) - INLINECODE22 — frame capture frequency (10-300 seconds)
- INLINECODE23 — receive summaries via webhook
- INLINECODE24 — number of summary windows before stopping
- INLINECODE25 — embed frames in summaries
Response: Returns a job_id.
4. Check Job Status
CODEBLOCK3
Job statuses: pending, running, stopped, completed, INLINECODE31
5. List All Jobs
CODEBLOCK4
Optional query params: status=running, type=live-monitor, limit=20, INLINECODE35
6. Cancel a Job
CODEBLOCK5
Recommended Workflows
Quick Check Workflow
- 1. Run check-once with the user's question and stream URL
- Report the
triggered result and explanation to the user - If the API returns an error about the stream, show the error and remediation
Monitoring Workflow
- 1. Test the condition with check-once first to verify it works
- If the condition works, start live-monitor with appropriate settings
- Return the jobid and inform user how to check status or cancel
- If webhookurl is available, set it up for push notifications
Summary Workflow
- 1. Start live-digest with the stream URL and appropriate window/interval
- Return the job_id so the user can check results later
Condition Writing Tips
- - Frame as binary yes/no questions: "Is there a person visible in the frame?"
- Be specific: "Is there smoke rising from the building roof?" not "Is there smoke?"
- One intent per condition — don't combine multiple checks
- Use positive phrasing: "Are vehicles visible?" not "Is the parking lot not empty?"
- Always test conditions with check-once before starting live-monitor
Error Handling
All errors return this structure:
CODEBLOCK6
Common error codes:
- -
NOT_LIVESTREAM — URL is not a live stream. Confirm it's actively broadcasting. - INLINECODE39 — Cannot reach the stream. Check URL and network.
- INLINECODE40 — Stream exists but is offline. Wait for it to go live.
- INLINECODE41 — Too many concurrent jobs. Cancel old ones with DELETE /jobs/{id}.
If you get an error, always show the remediation field to the user — it contains actionable guidance.
Pricing Reference
| Action | Cost |
|---|
| Check once | $0.01 / request |
| Live monitor |
$0.02 / minute |
| Live digest | $0.02 / minute |
Free tier: 100 credits ($1.00) on signup at https://console.machinefi.com
Rules
- - NEVER expose or log the $TRIOAPIKEY value in output shown to the user.
- ALWAYS show the
explanation field from check-once responses — it provides the VLM's reasoning. - ALWAYS test conditions with check-once before starting a live-monitor job.
- When a user provides a stream URL, auto-detect whether they want a quick check, monitoring, or digest based on their intent.
- For monitoring jobs, always return the job_id so the user can check status or cancel later.
- If the API returns an error, show the error code and remediation to the user.
- Inform users about credit costs before starting live-monitor or live-digest jobs (they charge per minute).
Trio Vision — 将任何摄像头变成智能摄像头
别再为每个影子收到愚蠢的动态警报了。用通俗英语描述真正重要的事情——只有当它发生时才会收到通知,直接发送到你的聊天中。由 Trio by MachineFi 提供支持。
使用场景
- - 用户询问摄像头、流媒体或视频源上正在发生什么(有人在我前门吗?)
- 用户希望针对特定事件收到智能警报(包裹送达时告诉我,如果我的狗跳上沙发就提醒我)
- 用户想要监控自己无法亲自查看的地方(建筑工地、停车位、仓库)
- 用户希望定期收到直播源的摘要(每10分钟总结一次这个直播)
- 用户提供任何直播流URL:YouTube Live、Twitch、RTSP/RTSPS摄像头、HLS流
前提条件
- - Trio API密钥。在 https://console.machinefi.com 免费获取一个(100积分)
- 设置密钥:export TRIOAPIKEY=yourkeyhere
- 基础URL:https://trio.machinefi.com/api
可用操作
1. 单次检查(快速快照)
询问关于流媒体当前可见内容的是/否问题。每次消耗1积分($0.01)。
bash
curl -s -X POST https://trio.machinefi.com/api/check-once \
-H Authorization: Bearer $TRIOAPIKEY \
-H Content-Type: application/json \
-d {
streamurl: STREAMURL_HERE,
condition: NATURALLANGUAGECONDITION_HERE
} | python3 -m json.tool
可选参数:
- - includeframe: true — 返回分析后的帧作为base64图像
- inputmode: clip — 分析短视频片段而非单帧(更适合运动检测)
- clipdurationseconds: 5 — 片段长度(1-10秒,仅适用于clip/hybrid模式)
响应字段:
- - triggered(布尔值)— 条件是否匹配
- explanation(字符串)— VLM对其所见内容的推理
- latency_ms — 处理时间(毫秒)
输入模式指南:
- - 使用 frames(默认)检测静态物体:车道上是否有车?,门是否开着?
- 使用 clip 检测运动/动作:是否有人在走路?,包裹是否已送达?
- 使用 hybrid 获得最大准确度(成本更高)
2. 实时监控(连续事件检测)
持续监控流媒体,当条件变为真时收到警报。每分钟消耗2积分($0.02/分钟)。
bash
curl -s -X POST https://trio.machinefi.com/api/live-monitor \
-H Authorization: Bearer $TRIOAPIKEY \
-H Content-Type: application/json \
-d {
streamurl: STREAMURL_HERE,
condition: NATURALLANGUAGECONDITION_HERE,
interval_seconds: 10,
monitordurationseconds: 600,
max_triggers: 1
} | python3 -m json.tool
可选参数:
- - webhookurl: https://your-server.com/webhook — 触发时接收HTTP POST通知
- intervalseconds: 10 — 检查频率(5-300秒)
- monitordurationseconds: 600 — 监控时长(最少5秒)
- triggercooldownseconds: 60 — 触发之间的最小间隔秒数
- maxtriggers: null — 设置为null以允许无限触发
- inputmode: clip — live-monitor的默认模式,适合运动检测
响应: 返回一个 job_id。用于检查状态或取消。
传递模式(基于请求自动选择):
- - 如果设置了 webhookurl → 事件通过POST发送到你的webhook
- 如果设置了 Accept: text/event-stream 头部(无webhook)→ SSE流
- 否则 → 通过 GET /jobs/{jobid} 轮询
3. 实时摘要(定期总结)
按固定时间间隔获取流媒体上发生事件的叙述性摘要。每分钟消耗2积分($0.02/分钟)。
bash
curl -s -X POST https://trio.machinefi.com/api/live-digest \
-H Authorization: Bearer $TRIOAPIKEY \
-H Content-Type: application/json \
-d {
streamurl: STREAMURL_HERE,
window_minutes: 10,
captureintervalseconds: 60
} | python3 -m json.tool
可选参数:
- - windowminutes: 10 — 摘要窗口长度(1-60分钟)
- captureintervalseconds: 60 — 帧捕获频率(10-300秒)
- webhookurl: https://... — 通过webhook接收摘要
- maxwindows: 3 — 停止前的摘要窗口数量
- includeframes: true — 在摘要中嵌入帧
响应: 返回一个 job_id。
4. 检查任务状态
bash
curl -s https://trio.machinefi.com/api/jobs/JOBIDHERE \
-H Authorization: Bearer $TRIOAPIKEY | python3 -m json.tool
任务状态: pending(待处理)、running(运行中)、stopped(已停止)、completed(已完成)、failed(失败)
5. 列出所有任务
bash
curl -s https://trio.machinefi.com/api/jobs?limit=20&offset=0 \
-H Authorization: Bearer $TRIOAPIKEY | python3 -m json.tool
可选查询参数:status=running、type=live-monitor、limit=20、offset=0
6. 取消任务
bash
curl -s -X DELETE https://trio.machinefi.com/api/jobs/JOBIDHERE \
-H Authorization: Bearer $TRIOAPIKEY | python3 -m json.tool
推荐工作流程
快速检查工作流程
- 1. 使用用户的问题和流URL运行check-once
- 向用户报告 triggered 结果和 explanation
- 如果API返回关于流的错误,显示错误和修复建议
监控工作流程
- 1. 先用check-once测试条件以验证其有效性
- 如果条件有效,使用适当设置启动live-monitor
- 返回jobid并告知用户如何检查状态或取消
- 如果webhookurl可用,设置它以接收推送通知
摘要工作流程
- 1. 使用流URL和适当的窗口/间隔启动live-digest
- 返回job_id以便用户稍后检查结果
条件编写技巧
- - 将条件表述为二元是/否问题:画面中是否有人可见?
- 要具体:是否有烟雾从建筑物屋顶升起?而不是是否有烟雾?
- 每个条件一个意图——不要组合多个检查
- 使用肯定表述:是否有车辆可见?而不是停车场是否不为空?
- 在启动live-monitor之前,始终用check-once测试条件
错误处理
所有错误返回此结构:
json
{
error: {
code: ERROR_CODE,
message: 人类可读的描述,
remediation: 可操作的修复建议
}
}
常见错误代码:
- - NOTLIVESTREAM — URL不是直播流。确认它正在活跃广播。
- STREAMFETCHFAILED — 无法访问流。检查URL和网络。
- STREAMOFFLINE — 流存在但离线。等待它上线。
- MAXJOBSREACHED — 并发任务过多。使用DELETE /jobs/{id}取消旧任务。
如果收到错误,始终向用户显示 remediation 字段——它包含可操作的指导。
定价参考
$0.02 / 分钟 |
| 实时摘要 | $0.02 / 分钟 |
免费层级:注册时赠送100积分($1.00),网址 https://console.machinefi.com
规则