Cloud Streaming Quickstart
Connect one camera, start cloud processing for an object detection Workflow, and view its results in the Web App, the Roboflow Agent, or the HTTP API.
Connect one camera and run a Workflow that detects objects and draws its predictions. Follow the Web App, Roboflow Agent, or HTTP API steps.
Before you start
You need a Roboflow workspace with credits for processing and a camera to connect. For an RTSP or USB camera, keep a computer running on the camera's network with the Video Connector installed. The connector must reach the camera and the internet.
Create and save a Workflow with:
One image input.
An Object Detection Model block named
model, using a model your workspace can run (ex:rfdetr-nano).A Bounding Box Visualization block that receives the input image and model predictions.
A
predictionsoutput and an image output from the visualization block, namedbounding_box_visualizationfor this guide.
Test the Workflow on video before you point it at a live camera. Put a short video of a scene the model recognizes in a folder and start the connector with --files-dir to loop the file as a live source. The file appears as a source you can run the Workflow on.
In the editor's run panel, "Enable Sinks" starts on. Turn it off while testing unless you want the Workflow to write to outside systems.
Publish the Workflow before you deploy it. A preview can run unpublished changes.
Web App
Connect the camera

Open "Deployments", then "Cloud Streaming".
Click "Add Video Source", then "Connect a Camera".
Follow "Run the Connector" on a computer that can reach your camera. Keep the command's API key private.
Wait for "Confirm It's Connected" to show the connector online, then click "Done".
Select the camera from the source list. For a network camera, add its RTSP URL or choose an ONVIF profile. USB cameras appear automatically on supported platforms.

Confirm that the source preview shows the intended camera. A thumbnail can be an older still, so do not use the thumbnail alone to confirm live video.
Start processing
Open the source and choose "Run a Workflow".
Select your saved Workflow under "Workflow".
Set the Workflow's options, if the form shows them. Fill required "Workflow Inputs" and leave optional ones blank to use their defaults. "Visual Preview Output" selects the first image output; choose
bounding_box_visualizationif the Workflow has more than one.Review the processing estimate and any confirmation shown, then click "Start Processing".

The app picks a GPU size from the Workflow's models. If the Workflow needs more GPU memory than that size has, the app moves it to a larger GPU automatically and the hourly rate changes to match. Starting can take time while a processor loads the model. The estimate is an hourly rate, not a fixed total. See pricing and limits.
Check the result
The source page shows the input and Workflow output. Check that boxes appear on the expected objects. Use the processing metrics to inspect performance, "Latest Result" for the newest structured output, and "Activity" for lifecycle events.

An image output is needed for annotated video, but not for a JSON-only Workflow. See consume results for output delivery and external integrations.
The run keeps processing after you leave the page or close the player. See manage and monitor to track your runs.
Start from the Workflow editor
You can also click "Deploy" in the Workflow editor (or "Use" when you open the Workflow in the Agent), choose "Cloud Streaming", and pick a connected source. This leads to the same flow.
To test unpublished changes instead, click "Run" in the editor and select a stream. This runs your changes for a short time, and any running deployment keeps going. Review Workflow lifecycle before making that preview continuous.
Roboflow Agent
Open the Agent and ask: "Help me connect a camera and preview my object detection Workflow."
Choose an existing camera, or use "Network Streams" to set up the connector. For a short test without a connector, choose "Webcam" or "Phone" and complete the camera or QR setup.
Ask the Agent to preview your saved Workflow's draft on the selected camera. Check the video and predictions. A preview does not replace the current deployment.
For a camera connected through the connector or RTMP, click "Deploy Stream" above the chat box, or ask: "Deploy this running preview continuously." Review the price and confirm. The deployment keeps the exact Workflow, state, and sink settings from the preview. It does not publish your draft or turn disabled sinks back on.
A browser webcam or phone QR session cannot be promoted. Keep the controlling browser open while using a temporary preview. For continuous use, connect a camera through the connector or RTMP instead. If you only ask to disconnect a preview, a separate deployment keeps running.
HTTP API
Use a workspace API key with the video-inference-job:create, video-inference-job:read, workflow:read, and model:infer scopes. See API authentication. Your workspace and Workflow slugs are in the Workflow editor's URL: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG.
Find the source
List your sources and copy the id of a camera whose status is connected.
Lists registered sources without stream credentials. Temporary sessions are excluded unless requested. The response contains sources only, not jobs or a webcam-availability flag. Requires video-inference-job:read. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound keys are not accepted.
Roboflow API key or OAuth access token.
Workspace URL slug.
Include workspace temporary sessions.
falseSuccessful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
GET /{workspace}/video-sources/v1 HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"sources": [
{
"id": "SOURCE_ID",
"workspace": "WORKSPACE_ID",
"kind": "usb",
"name": "Warehouse camera",
"status": "connected",
"availableProcessorSizes": [
"gpu-s-v1",
"gpu-m-v1",
"gpu-l-v1"
],
"persistentWorkflowsAvailable": true
}
]
}Check the Workflow's inputs and outputs
Pick an output with isImage: true (ex: bounding_box_visualization) to get annotated video. Set other inputs with workflowParameters. The camera supplies the image input.
Inspect a saved Workflow before selecting imageOutput and workflowParameters. This does not start processing. Requires video-inference-job:read. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound keys are not accepted.
Roboflow API key or OAuth access token.
Workspace URL slug.
The saved Workflow's URL slug: the last part of its editor URL (ex: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG).
YOUR_WORKFLOW_SLUGSuccessful response.
True when static analysis was used because interface discovery failed. In that case, isImage=false is not proof that the output is not an image.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
GET /{workspace}/video-sources/v1/workflow-interface?workflowUrl=YOUR_WORKFLOW_SLUG HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"outputs": [
{
"name": "label_visualization_output",
"kinds": [
"image"
],
"isImage": true
}
],
"degraded": false,
"parameters": []
}Start the job
Send a new Idempotency-Key for each run. With only workflowUrl, the job is a deployment on a Small GPU that keeps running after your script exits. Add processorSize for heavier models (see GPU sizes).
Starts metered processing. Send a new Idempotency-Key for one intentional run; retry uncertain responses with the same key, body and API key. Different keys can create separate billable jobs. A successful start can be queued or waiting, not yet running. API requests (authenticated with your API key) use the processorSize you send, or the default profile. The app's automatic sizing, automatic resizing and priced validation are not available through this API. Requires a workspace API key with video-inference-job:create, workflow:read and model:infer. OAuth access tokens and device-bound keys cannot start jobs. A folder-scoped key can start jobs only on sources in its folders, and only with recoveryPolicy none. The same admitted API key supplies execution authority.
Roboflow API key or OAuth access token.
Workspace URL slug.
Cloud Streaming source ID from the source list.
^[^/\\]+$A unique key for one start attempt. Reuse the same key, request and credential after a lost response. Use a new key only for a new attempt.
run-warehouse-camera-001Pattern: ^[A-Za-z0-9._:-]+$Required unless you send workflowSpecification. The saved Workflow's URL slug in this workspace: the last part of its editor URL (ex: app.roboflow.com/YOUR_WORKSPACE/workflows/edit/YOUR_WORKFLOW_SLUG). The job runs the Workflow's published version. Send either workflowUrl or workflowSpecification, not both.
YOUR_WORKFLOW_SLUGDeclared non-image inputs, fixed for this job's lifetime. Maximum JSON-encoded UTF-8 size: 256 KiB. Image inputs come from the source. Inspect workflow-interface for declared names and defaults. Job records expose only these key names, not the values.
Optional. Name of the Workflow image output to publish when watched (ex: label_visualization_output). Find it with Inspect a Workflow interface. Null or omission leaves the default selection to the runtime. A JSON-only Workflow does not need an image output.
label_visualization_outputUploaded sources default to batch, processing every frame in order as fast as inference allows. stream uses real-time pacing and can drop frames under load. Non-uploaded sources always use stream, even if batch is requested.
Optional. deployment keeps processing without a viewer until you stop it. preview is a bounded test run: it never recovers, ends when idle, and stops after one hour. Default: deployment for durable sources, preview for temporary sources. A temporary source accepts only preview. API-created previews cannot be promoted in the app.
Saved Workflow identifier associated with a draft preview. This is provenance, not permission to promote or automatically replace another preview.
Optional. always makes a deployment wait and resume automatically after an interruption (ex: the source goes offline). none ends the job instead. Default: always for deployments on durable live sources where recovery is enabled, otherwise none. Uploaded files, temporary sources and jobs started with a folder-scoped key do not recover. A preview requires none. A persistent saved Workflow pins its published specification when created; nonpersistent saved Workflows resolve it at claim time.
Optional. Processing tier. The only documented value is gpu, which is also the default.
gpuPossible values: Optional. GPU profile: gpu-s-v1 (Small, 4 GiB GPU memory), gpu-m-v1 (Medium, 8 GiB) or gpu-l-v1 (Large, 16 GiB). Pick a larger profile for heavier Workflows; larger profiles cost more per hour. Default: gpu-s-v1 (Small). The source record's availableProcessorSizes lists the profiles you can use. API-created jobs are not sized from the Workflow and do not move to a larger profile after a GPU memory error, so send an explicit size. Availability can vary by source and cell.
gpu-s-v1Possible values: Optional. Processing rate cap in frames per second, greater than 0 and at most 240. Default: null, which adds no job-specific cap. This is not a throughput guarantee.
15Optional ingest tuning in key;value|key;value format. Keys: rtsp_transport, buffer_size, max_delay, reorder_queue_size, stimeout, timeout, probesize, analyzeduration, fflags, flags. Each value contains 1-64 letters, digits, underscores, plus signs, dots or hyphens. Null uses runtime defaults.
rtsp_transport;tcpOptional capture queue depth. Null or omission uses the runtime default for the processing mode.
Optional processing cell allowed for this workspace and source. Omit it for server placement; do not infer a cell from a connector download host. An active or fixed source cannot move freely between cells.
^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$Compatibility field. External calls are always recorded as api, regardless of this value. Omit it.
Identical request replayed under the same key and credential; returns the original job.
New job created. Read its state before assuming processing has started.
Invalid or unknown field, conflicting Workflow fields, excessive specification/parameter size, invalid capture options, or incompatible source, lifetime, recovery or compute settings.
Authentication is missing or invalid.
Required scopes, eligible workspace credit standing or environment capability are missing, or an OAuth, folder-scoped or device-bound credential cannot start this job. Some access denials are hidden as 404.
The resource does not exist or is not accessible.
The idempotency key belongs to different parameters or credentials, the prior job is no longer available, or source/cell placement or capacity conflicts.
The request rate is too high.
A required upstream service is temporarily unavailable.
POST /{workspace}/video-sources/v1/{sourceId}/jobs HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Idempotency-Key: text
Content-Type: application/json
Accept: */*
Content-Length: 180
{
"workflowUrl": "YOUR_WORKFLOW_SLUG",
"imageOutput": "label_visualization_output",
"purpose": "deployment",
"recoveryPolicy": "always",
"tier": "gpu",
"processorSize": "gpu-s-v1",
"maxFps": 15
}{
"job": {
"id": "JOB_ID",
"sourceId": "SOURCE_ID",
"state": "running",
"purpose": "deployment",
"mode": "stream",
"tier": "gpu",
"processorSize": "gpu-s-v1",
"workflowUrl": "YOUR_WORKFLOW_SLUG",
"imageOutput": "label_visualization_output",
"executionGeneration": 1,
"cancelRequested": false
}
}Check the job
Read the job until state is running.
Read the current job without changing its state. Follow executionGeneration and successorJobId when observing replacement executions. A persistent waiting or blocked job still represents enabled intent until explicitly cancelled. Requires video-inference-job:read. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound keys are not accepted.
Roboflow API key or OAuth access token.
Workspace URL slug.
Job ID.
^[^/\\]+$Successful response.
The request is invalid.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
GET /{workspace}/video-jobs/v1/{jobId} HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"job": {
"id": "JOB_ID",
"sourceId": "SOURCE_ID",
"state": "running",
"purpose": "deployment",
"mode": "stream",
"tier": "gpu",
"processorSize": "gpu-s-v1",
"workflowUrl": "YOUR_WORKFLOW_SLUG",
"imageOutput": "label_visualization_output",
"executionGeneration": 1,
"cancelRequested": false
}
}Get the results
Request a watch grant for the image output and open whepUrl in a WHEP-compatible player. Repeat the request every 30 seconds while you watch. Keep these URLs private.
Requests publication for at least 60 seconds on a claimed or running job. Renew at least every 30 seconds while viewing; renewal never shortens the lease. One image output is selected for the whole job, so another viewer's output selection changes every viewer's stream. Request a fresh grant after a new execution; match executionGeneration when provided. This does not create durable frame history. Requires video-inference-job:create. Use a workspace API key or OAuth access token for the workspace in the path. Device-bound and folder-scoped credentials are not accepted.
Roboflow API key or OAuth access token.
Workspace URL slug.
Job ID.
^[^/\\]+$Name of a Workflow image output, without a selector prefix. Null or omission uses the job's default selection.
label_visualization_outputSuccessful response.
Generation associated with this grant, when present on the job. Match it to the current job and request a fresh grant after execution changes.
Credentialed WHEP URL for annotated output. Use unchanged; do not log, persist or share it.
Credentialed RTSPS URL for the same output, or null when the cell has no public RTSPS listener.
Opaque execution-scoped credential. It changes on a new claim. Do not log, persist or share it. Its presence does not establish a public processor polling contract.
The job is not claimed/running, cancellation is pending, the output is not accepted as image-producing, or the Workflow changed while selecting output. With degraded static analysis, a declared output may be accepted without proof that it is an image; a non-image output will not publish video.
Authentication is missing or invalid.
The credential does not have access to this resource.
The resource does not exist or is not accessible.
The request rate is too high.
A required upstream service is temporarily unavailable.
POST /{workspace}/video-jobs/v1/{jobId}/watch HTTP/1.1
Host: api.roboflow.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 39
{
"output": "label_visualization_output"
}{
"watch": {
"requestedUntil": 1800000060000,
"output": "label_visualization_output"
},
"executionGeneration": 1,
"whepUrl": "https://relay.example.invalid/out-JOB_ID-g1/whep?key=JOB_READ_GRANT",
"rtspsUrl": null,
"processorAccessToken": "EXECUTION_SCOPED_TOKEN"
}To send predictions to your own application, add a Webhook Sink to the Workflow.
Last updated
Was this helpful?