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.
How it works
Section titled “How it works”- Create a Lightcone browser session
- Connect to it via Playwright using the CDP endpoint
- Run the OpenAI CUA loop — the model sees screenshots, decides actions, and Playwright executes them
pip install tzafon playwright openaiplaywright install chromiumExample
Section titled “Example”from tzafon import Lightconefrom playwright.sync_api import sync_playwrightfrom openai import OpenAI
# Create a Lightcone browser sessionlc = Lightcone()session = lc.computers.create(kind="browser")
# Get the CDP endpointcdp_url = session.endpoints.get("cdp")
# Connect Playwright to the remote browserwith 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)Why use Lightcone with OpenAI CUA?
Section titled “Why use Lightcone with OpenAI CUA?”- 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
Resources
Section titled “Resources”See also
Section titled “See also”- CUA protocol guide — build a CUA loop with Lightcone’s native API
- Anthropic Claude — Claude’s computer-use with Lightcone
- Playwright — CDP connection details