# Can a self-hosted agent be launched through an API

**URL:** <https://forum.cursor.com/t/can-a-self-hosted-agent-be-launched-through-an-api/158121>\
**Category:** Help\
**Tags:** cloud-agents\
**Created:** [April 16, 2026, 2:00am UTC](https://forum.cursor.com/t/can-a-self-hosted-agent-be-launched-through-an-api/158121 "2026-04-16T02:00:50Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![deanrie](https://sea3.discourse-cdn.com/cursor1/user_avatar/forum.cursor.com/deanrie/32/1263_2.png) [@deanrie](https://forum.cursor.com/u/deanrie)\
**Post date:** [April 18, 2026, 9:23am UTC](https://forum.cursor.com/t/can-a-self-hosted-agent-be-launched-through-an-api/158121/5 "2026-04-18T09:23:44Z")

</div>

Hey, yep, this is supported. In the request body for `POST /v0/agents`, pass an extra parameter `"usePrivateWorker": true`, and the run will go to your self-hosted worker instead of a Cursor-hosted VM.

Example:

```json
{
  "prompt": { "text": "..." },
  "model": "claude-4.5-sonnet-thinking",
  "source": { "repository": "https://github.com/your-org/your-repo", "ref": "main" },
  "target": { "autoCreatePr": true, "branchName": "feature/add-readme" },
  "usePrivateWorker": true
}

```

For this to work, you need:

- A deployed self-hosted worker connected to your team, see [Self-Hosted Pool | Cursor Docs](https://cursor.com/docs/cloud-agent/self-hosted-pool)
- In Team Dashboard \> Cloud Agents \> Self-hosted Agents, turn on Allow Self-hosted Agents

If you want to force all runs API + Automations + UI to use only self-hosted, there is also a toggle there called Require Self-hosted Agents for All Cloud Agents. There is a known issue with that toggle right now for some teams it does not persist. It is being tracked, and I can’t share an ETA yet. As a temporary workaround, use `"usePrivateWorker": true` per request. It works independently.

Important: self-hosted Cloud Agents are a Team or Enterprise feature. They are not available on Pro in a personal account. You need a team plan with a configured worker pool.

More details on the same topic are in this thread: [this t​hread](https://forum.cursor.com/t/how-to-ensure-automations-and-api-agent-runs-use-self-hosted-workers-only-not-cursor-hosted/156021/5). If anything does not work, tell me and we will troubleshoot it.

---

_[View the full topic](https://forum.cursor.com/t/can-a-self-hosted-agent-be-launched-through-an-api/158121)._
