> ## Documentation Index
> Fetch the complete documentation index at: https://docs.machinefi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# First Successful Workflow

> Go from API key to a working Trio job in under 15 minutes

## Goal

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

## Prerequisites

* API key from [console.machinefi.com](https://console.machinefi.com)
* A live stream URL (YouTube Live, Twitch, RTSP, or RTSPS)

## Step 1: Validate Stream Liveness

```bash theme={null}
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

```bash theme={null}
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

```bash theme={null}
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

```bash theme={null}
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)

```bash theme={null}
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

* Choose best mode for your app: [Choose Your Workflow](/start-here/choose-workflow)
* Write stronger prompts: [Writing Reliable Conditions](/guides/writing-conditions)
* Production delivery patterns: [Guides](/guides/webhooks)
