Skip to content
Dashboard
Integrations

OpenAI CUA

Run OpenAI's Computer-Using Agent on Lightcone browser sessions.

Run OpenAI’s Computer-Using Agent (CUA) on Lightcone cloud browsers. CUA is OpenAI’s protocol for AI agents that see and interact with computer screens. Lightcone provides the sandboxed browser environment; OpenAI’s CUA model provides the vision and reasoning.

  1. Create a Lightcone browser session
  2. Connect to it via Playwright using the CDP endpoint
  3. Run the OpenAI CUA loop — the model sees screenshots, decides actions, and Playwright executes them
Terminal window
pip install tzafon playwright openai
playwright install chromium
from tzafon import Lightcone
from playwright.sync_api import sync_playwright
from openai import OpenAI
# Create a Lightcone browser session
lc = Lightcone()
session = lc.computers.create(kind="browser")
# Get the CDP endpoint
cdp_url = session.endpoints.get("cdp")
# Connect Playwright to the remote browser
with sync_playwright() as p:
browser = p.chromium.connect_over_cdp(cdp_url)
page = browser.contexts[0].pages[0]
# Navigate
page.goto("https://example.com")
# Take a screenshot for CUA
screenshot = page.screenshot()
# Use OpenAI CUA to reason about the page
client = OpenAI()
response = client.responses.create(
model="computer-use-preview",
tools=[{
"type": "computer_use_preview",
"display_width": 1280,
"display_height": 720,
"environment": "browser",
}],
input=[{
"role": "user",
"content": [
{"type": "input_text", "text": "Find the main heading on this page"},
{"type": "input_image", "image_url": f"data:image/png;base64,{screenshot.hex()}"},
],
}],
)
print(response.output)
browser.close()
lc.computers.delete(session.id)
  • Stealth browsers — Lightcone’s browsers include anti-detection features that prevent sites from blocking automation
  • Residential proxies — Route traffic through residential IPs for additional stealth
  • Session persistence — Save and restore browser state (cookies, local storage) across runs
  • Scalability — Spin up hundreds of concurrent browser sessions