Skip to main content
POST
/
single-actions
/
run-action
import requests

payload = {
    "cdp_url": "ws://localhost:9222/devtools/page/123",
    "action": "Open Google Calendar and create a meeting called {{meeting_title}} for tomorrow at 3pm",
    "id": "calendar-meeting-step",
    "variables": {
        "meeting_title": "Internal sync"
    },
    "screen_config": {
        "width": 1440,
        "height": 900
    },
    "set_cache": True
}

response = requests.post(
    "https://api.usedari.com/single-actions/run-action",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json=payload
)

print(response.json())
{
  "success": true,
  "result": "Meeting scheduled for tomorrow at 3:00 PM",
  "credits": 4,
  "used_cache": false,
  "set_cache": true,
  "cache_failed": false
}
This endpoint lets you trigger a single computer-use browser action against an active Chrome DevTools target. It optionally reuses cached state for faster follow-up actions.

Headers

X-API-Key
string
required
Your API key for authentication
Content-Type
string
required
Must be application/json

Request Body

cdp_url
string
required
Chrome DevTools Protocol WebSocket URL for the browser session to control
action
string
required
Natural language instruction describing the action to perform
id
string
Optional stable identifier that lets you reuse cached step instances across runs
variables
object
Optional mapping of variable names to values that can be referenced inside the action prompt
screen_config
object
Optional window configuration with width and height; defaults to 1280x720
set_cache
boolean
Whether to refresh the cached step instance for this action; defaults to true

Response Fields

success
boolean
Indicates whether the action completed without errors
result
string
Textual outcome returned by the computer-use agent, if available
credits
integer
Number of credits consumed by this execution, when applicable
error
string
Error message when the action fails
used_cache
boolean
true when a previously cached step instance was reused
set_cache
boolean
true when the cache was stored or updated during this run
cache_failed
boolean
true if cached data existed but could not be applied, forcing a fresh run
import requests

payload = {
    "cdp_url": "ws://localhost:9222/devtools/page/123",
    "action": "Open Google Calendar and create a meeting called {{meeting_title}} for tomorrow at 3pm",
    "id": "calendar-meeting-step",
    "variables": {
        "meeting_title": "Internal sync"
    },
    "screen_config": {
        "width": 1440,
        "height": 900
    },
    "set_cache": True
}

response = requests.post(
    "https://api.usedari.com/single-actions/run-action",
    headers={
        "X-API-Key": "YOUR_API_KEY",
        "Content-Type": "application/json"
    },
    json=payload
)

print(response.json())
{
  "success": true,
  "result": "Meeting scheduled for tomorrow at 3:00 PM",
  "credits": 4,
  "used_cache": false,
  "set_cache": true,
  "cache_failed": false
}

Usage Notes

  • Provide a live cdp_url for a Chrome instance launched with remote debugging.
  • Reuse the same id to keep a cached step instance and speed up future runs; used_cache shows when it is applied.
  • Set set_cache to false to bypass cache updates when testing or replaying an action.
  • The agent can substitute values from variables inside the action prompt when your template expects dynamic data.

Error Responses

{
  "detail": "Invalid API key"
}
{
  "detail": "Failed to run single action: internal error"
}