POST
/
v0
/
agents
Launch an agent
curl --request POST \
  --url https://api.cursor.com/v0/agents \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "prompt": {
    "text": "Add a README.md file with installation instructions",
    "images": [
      {
        "data": "iVBORw0KGgoAAAANSUhEUgAA...",
        "dimension": {
          "width": 1024,
          "height": 768
        }
      }
    ]
  },
  "source": {
    "repository": "https://github.com/your-org/your-repo",
    "ref": "main"
  }
}'
{
  "id": "bc_abc123",
  "name": "Add README Documentation",
  "status": "CREATING",
  "source": {
    "repository": "https://github.com/your-org/your-repo",
    "ref": "main"
  },
  "target": {
    "branchName": "cursor/add-readme-1234",
    "url": "https://cursor.com/agents?id=bc_abc123",
    "autoCreatePr": false
  },
  "createdAt": "2024-01-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

API key from Cursor Dashboard

Body

application/json
prompt
object
required
source
object
required
model
string

The LLM to use

Minimum length: 1
Example:

"claude-4-sonnet"

target
object
webhook
object

Response

Agent created successfully

id
string
required

Unique identifier for the background agent

Example:

"bc_abc123"

name
string
required

Name for the agent

Example:

"Add README Documentation"

status
enum<string>
required

Initial status of the newly created agent

Available options:
CREATING
Example:

"CREATING"

source
object
required
target
object
required
createdAt
string<date-time>
required

When the agent was created

Example:

"2024-01-15T10:30:00Z"