> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/agents/roboflow-agent.md).

# Roboflow Agent

The in-app Roboflow Agent that builds, runs, and debugs Workflows and Rapid models, plus its HTTP chat API.

## About

Roboflow Agent has access to your [Workspace](/platform/workspaces/key-concepts.md) and can create, edit, run, and debug [Workflows](https://docs.roboflow.com/workflows). You can also use it to set up [Rapid](https://docs.roboflow.com/models/rapid/rapid) models. Access the Agent by clicking "Agent" in the left sidebar of your workspace.

<figure><img src="https://4160767428-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1YMZNIiZMBdlCHUDeZMP%2Fuploads%2Fgit-blob-e08163ee75bce9853bb94d3581efc5910405e091%2Frf-agent.png?alt=media" alt=""><figcaption></figcaption></figure>

### Capabilities

The Agent can work with:

* [Workflows](https://docs.roboflow.com/workflows): build from a plain description, run on images, RTSP streams, video, your browser webcam, or your phone camera, run only the part of a video you ask for, watch live previews, auto-fix failures, investigate run errors, and draw detection zones. To add a camera, pick "Webcam", "Network Streams", or "Phone" when the Agent asks. A webcam or phone stream stops when its browser session ends.
* Attached media: analyze images and MP4 or MOV videos you drop into the chat, and build and verify Workflows with them.
* Image generation: create 1 to 10 images from a text description when you have no photos yet. The Agent starts when you ask it to generate. Ask for a price first if you want an estimate. Each image is saved to your [Asset Library](/platform/workspaces/asset-library.md), and you pay only for the images that are saved. The Agent cannot use your own images as a reference.
* [Rapid](https://docs.roboflow.com/models/rapid/rapid) models: set up, manage, and diagnose training failures.
* Projects: [create projects](https://docs.roboflow.com/datasets/create-and-upload/create-a-project#create-a-project-from-the-agent), start [model training](https://docs.roboflow.com/models/train/train-a-model#train-from-the-agent), [rebalance splits](https://docs.roboflow.com/datasets/versions/dataset-versions/create-a-dataset-version#readjusting-train-validation-test-splits), and [merge projects](https://docs.roboflow.com/datasets/manage/merge-datasets).
* Universe datasets: find public datasets on [Universe](https://docs.roboflow.com/datasets/universe/universe/what-is-roboflow-universe), compare them, and [copy a whole dataset or a set number of images](https://docs.roboflow.com/datasets/universe/universe/fork-a-universe-dataset#roboflow-agent) into a project. You agree on sources, image counts, and class changes in the chat before the Agent copies anything.
* Datasets: [browse images by labeling stage](https://docs.roboflow.com/datasets/annotate/annotate/team-collaboration#browse-labeling-work-from-the-agent), [add workspace images to a model and start labeling them](https://docs.roboflow.com/datasets/annotate/annotate/team-collaboration#add-images-and-start-annotating), send a batch to review or back for edits, approve or reject images in Review (after you confirm the jobs and image count), accept images into the dataset, and return work to unassigned.
* [Batch Processing](https://docs.roboflow.com/deployment/roboflow-cloud/batch-processing): run a published Workflow over images in your Asset Library, set up a new job with you in the chat, list your jobs, and report the status of one.
* [Active Learning](https://docs.roboflow.com/deployment/monitoring-and-analytics/active-learning): turn collection on or off per project and edit its limits and conditions.
* [Vision Events](https://docs.roboflow.com/deployment/monitoring-and-analytics/vision-events): add blocks to Workflows, [answer questions about your event data](https://docs.roboflow.com/deployment/monitoring-and-analytics/vision-events/query-events), and schedule [Summary Reports](https://docs.roboflow.com/deployment/monitoring-and-analytics/vision-events/summary-reports).
* Usage: show your [Credit Usage Dashboard](/platform/billing-and-plans/credits/view-credit-usage.md) with filters matching your question.
* Edge devices: answer questions with read-only access to your [Deployment Manager](https://docs.roboflow.com/deployment/self-hosted/enterprise/deployment-manager) fleet, telemetry, logs, and streams.
* Tabs: organize open Workflows, models, projects, and usage views; drag to reorder; reopen closed items or create new ones from the "+" tab.

### Cloud Streaming

Ask the Agent to connect a camera, select an existing source, and preview a Workflow draft with [Cloud Streaming](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming). Use "Network Streams" for a connector on the camera's network, or "Webcam" and "Phone" for a temporary browser session.

To keep an eligible camera preview running, explicitly ask to deploy it. Promotion preserves the current snapshot, runtime state, and sink settings without publishing or restarting. A temporary webcam or phone session cannot be promoted. To apply later edits, explicitly ask to update the deployment; publishing alone does not change the running job.

Name the Workflow or job when asking to stop it. Disconnecting a preview or closing chat does not stop a separate continuous deployment. Follow the [Agent quickstart](https://docs.roboflow.com/deployment/roboflow-cloud/cloud-streaming/quickstart#roboflow-agent) for the full journey and its billing and lifetime limits. These in-app actions are not standalone public SDK methods.

### Background Tasks

Long jobs the Agent starts keep running while you chat: model training, Universe dataset copies, auto-labeling, dataset version generation, project merges, class remaps, split rebalances, and Batch Processing jobs. A pill above the chat box counts the running ones. Click it, or click "Background Tasks" in the left menu, to open a panel that lists them under "Running" and "Finished". Click a task to open the page it created.

The Agent tells you in the chat when a task finishes, even if you closed the tab and came back later. Only jobs started from inside a conversation appear here. A training you start elsewhere in the app or through the API does not, and you track it in the Activity Center instead.

### Workspace LLM Keys

You can run the Agent on your own OpenAI or Azure OpenAI key, so your data does not go through Roboflow's LLM keys. This also covers the Workflow editor assistant, the custom block assistant, and the Agent API.

{% hint style="info" %}
Roboflow must turn this feature on for your Workspace. Contact your account team to request it. It is not available in the EU region.
{% endhint %}

1. In your Workspace settings, click "Third Party Keys".
2. Add your OpenAI API key, or your Azure OpenAI "Resource Name" and "Azure OpenAI API Key".
3. In "Workspace LLM Keys", pick a "Provider" and "Model". For Azure OpenAI, also enter the "Deployment Name" and "Model Behind This Deployment".
4. Click "Test Connection".
5. Turn on "Enforce Workspace LLM Keys", then click "Save".

When this is on, every request uses your key. If your key fails, the request stops with an error and never falls back to Roboflow's keys. Workflow OpenAI and Gemini blocks run on your Workspace keys, and AI features that cannot (ex: other LLM blocks) are turned off. Conversation traces are not recorded, and LLM cost is not charged as credits.

Image generation is turned off while "Enforce Workspace LLM Keys" is on.

If you use Azure OpenAI, Workflow OpenAI blocks still need an OpenAI API key under "Third Party Keys". Without one, the Agent cannot add OpenAI blocks to your Workflows.

{% hint style="info" %}
The Agent runs on the model you pick, so it can behave differently than it does on Roboflow's keys. Some tasks may work differently or give different results, depending on what that model supports.
{% endhint %}

## HTTP API

The Agent API lets you interact with the Roboflow AI agent through `api.roboflow.com`. You can send natural-language instructions to create or edit [Workflows](https://docs.roboflow.com/workflows/build/create-a-workflow), then publish them when ready. All edits are saved as drafts until you explicitly publish.

Authentication is via [API key](https://docs.roboflow.com/reference/platform/rest-api/authenticate-with-the-rest-api). If you use a [Scoped API Key](https://docs.roboflow.com/reference/authentication/authentication/scoped-api-keys) with folder restrictions, the agent will only be able to access Workflows and models within that folder scope, and it will not see projects that sit outside a folder. Asking the agent to list workspace models returns only the models the caller can already see.

### Chat

Send a message to the agent. Start a new conversation, or continue one by passing `conversation_id`.

{% openapi src="/files/AJ4ZFCHIBc3AWX3yfVQ3" path="/{workspace}/agent/chat" method="post" %}
[agent-api.yaml](https://4160767428-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1YMZNIiZMBdlCHUDeZMP%2Fuploads%2Fgit-blob-fe7368626d50bfa1cbdc6309c07567b2b9391c85%2Fagent-api.yaml?alt=media)
{% endopenapi %}

### Publish a Workflow

Deploy the latest draft of a Workflow the agent created or edited.

{% openapi src="/files/AJ4ZFCHIBc3AWX3yfVQ3" path="/{workspace}/agent/workflows/{workflowUrl}/publish" method="post" %}
[agent-api.yaml](https://4160767428-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1YMZNIiZMBdlCHUDeZMP%2Fuploads%2Fgit-blob-fe7368626d50bfa1cbdc6309c07567b2b9391c85%2Fagent-api.yaml?alt=media)
{% endopenapi %}

### List Conversations

{% openapi src="/files/AJ4ZFCHIBc3AWX3yfVQ3" path="/{workspace}/agent/conversations" method="get" %}
[agent-api.yaml](https://4160767428-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1YMZNIiZMBdlCHUDeZMP%2Fuploads%2Fgit-blob-fe7368626d50bfa1cbdc6309c07567b2b9391c85%2Fagent-api.yaml?alt=media)
{% endopenapi %}

### Get a Conversation

{% openapi src="/files/AJ4ZFCHIBc3AWX3yfVQ3" path="/{workspace}/agent/conversations/{id}" method="get" %}
[agent-api.yaml](https://4160767428-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1YMZNIiZMBdlCHUDeZMP%2Fuploads%2Fgit-blob-fe7368626d50bfa1cbdc6309c07567b2b9391c85%2Fagent-api.yaml?alt=media)
{% endopenapi %}

## MCP Server

Connect your AI agent to the [MCP Server](/agents/mcp-server.md) and it can hand work to Roboflow Agent with these tools:

<table data-search="false"><thead><tr><th width="290">Tool</th><th>Description</th></tr></thead><tbody><tr><td><code>agent_chat</code></td><td>Chat with the Roboflow AI agent.</td></tr><tr><td><code>agent_chat_result</code></td><td>Collect the result of a run that was still working.</td></tr><tr><td><code>agent_conversations_list</code></td><td>List agent conversations in the workspace.</td></tr><tr><td><code>agent_conversation_get</code></td><td>Get one conversation with its message history.</td></tr><tr><td><code>agent_workflow_publish</code></td><td>Publish the latest agent-edited draft of a Workflow.</td></tr></tbody></table>
