Built-in Tool
Computer Use Beta
Enable models to perceive and interact with graphical computer interfaces. Computer Use allows agents to browse the web, fill forms, click buttons, type text, take screenshots, and navigate desktop applications — autonomously completing complex GUI-based workflows.
Browser Control
Navigate web pages, click links, fill forms, submit data, and scrape information from any website — just like a human user.
Desktop Automation
Interact with desktop applications, open files, navigate menus, copy-paste content, and execute multi-step GUI workflows.
Visual Perception
The model sees the screen via screenshots and interprets visual elements, layouts, buttons, text fields, and UI components.
How It Works
Computer Use operates through a screenshot-action loop. The model receives a screenshot of the current state, decides what action to take, and returns an action command. Your environment executes the action and sends back the next screenshot.
Capture Screenshot
Your application takes a screenshot of the current display state and encodes it as a base64 image or file ID.
Send to Model
The screenshot is passed to the model via the computer_use_preview tool along with the current task description.
Model Returns Action
The model analyzes the screenshot and returns a computer action: click, type, scroll, key press, or screenshot request.
Execute Action
Your environment executes the action using a tool like Playwright, pyautogui, or a remote desktop API.
Repeat Until Done
The loop continues — capture, send, act — until the model signals task completion or a stopping condition is met.
Environment Setup
You need to provide a display environment. The most common setup uses a headless browser (Playwright) or a virtual display (Xvfb) for Linux. Windows and macOS desktop automation can use pyautogui.
pip install playwright playwright install chromium
pip install pyautogui pillow
Python Example
The following example demonstrates a complete screenshot-action loop using Playwright to control a browser.
import base64 from GlomaxGPT import GlomaxGPT from playwright.sync_api import sync_playwright client = GlomaxGPT() def take_screenshot(page): """Take a screenshot and return as base64.""" screenshot_bytes = page.screenshot() return base64.b64encode(screenshot_bytes).decode("utf-8") def execute_action(page, action): """Execute a computer action on the page.""" if action.type == "click": page.mouse.click(action.coordinate[0], action.coordinate[1]) elif action.type == "type": page.keyboard.type(action.text) elif action.type == "scroll": page.mouse.wheel(action.coordinate[0], action.coordinate[1]) elif action.type == "key": page.keyboard.press(action.key) elif action.type == "screenshot": pass # Just take a new screenshot with sync_playwright() as p: browser = p.chromium.launch(headless=True) page = browser.new_page(viewport={"width": 1280, "height": 720}) page.goto("https://example.com") task = "Navigate to the About page and extract the company founding year." screenshot_b64 = take_screenshot(page) messages = [{ "role": "user", "content": [ {"type": "text", "text": task}, { "type": "input_image", "image_url": f"data:image/png;base64,{screenshot_b64}" } ] }] while True: response = client.responses.create( model="glomaxgpt-ultra", input=messages, tools=[{ "type": "computer_use_preview", "display_width": 1280, "display_height": 720, "environment": "browser" }], truncation="auto" ) # Check for computer use actions computer_calls = [ item for item in response.output if item.type == "computer_call" ] if not computer_calls: # No more actions — task is complete print(response.output_text) break for call in computer_calls: execute_action(page, call.action) # Take new screenshot and continue loop new_screenshot = take_screenshot(page) messages.append({ "role": "tool", "tool_call_id": computer_calls[-1].id, "content": [{ "type": "input_image", "image_url": f"data:image/png;base64,{new_screenshot}" }] }) browser.close()
Action Types
The model can produce any of the following action types. Your application is responsible for executing each action in the target environment.
| Action Type | Parametreler | Description |
|---|---|---|
click |
coordinate: [x, y], button: "left"|"right"|"middle" |
Click at screen coordinates |
double_click |
coordinate: [x, y] |
Double-click at coordinates |
type |
text: string |
Type text at the current focus |
key |
key: string |
Press a keyboard key (e.g., "Enter", "Tab", "ctrl+c") |
scroll |
coordinate: [x, y], delta_x: number, delta_y: number |
Scroll the viewport |
drag |
start_coordinate: [x, y], end_coordinate: [x, y] |
Click-drag from one point to another |
move |
coordinate: [x, y] |
Move mouse to coordinates without clicking |
screenshot |
— | Request a new screenshot of the current state |
wait |
duration: number |
Wait for the specified number of milliseconds |
Security Considerations
Principle of Least Privilege
Run Computer Use in an isolated environment with minimal permissions. Use a dedicated browser profile or sandboxed VM without access to personal accounts or sensitive systems.
Human-in-the-Loop
For high-stakes actions (form submissions, purchases, deletions), pause the loop and require human confirmation before proceeding. Never allow fully autonomous irreversible actions without oversight.
Prompt Injection Defense
Web pages may contain adversarial content designed to manipulate the model. Sanitize visible content, limit what the model can read from the page, and validate all actions against expected task scope.
Action Logging
Log all screenshots and actions for auditing purposes. Keep a full trace of every model decision and the resulting state for post-hoc review and debugging.
Sensitive Data Isolation
Do not pass screenshots containing passwords, payment details, or PII unless strictly necessary. Blur or mask sensitive areas before sending to the API.
⏱ Rate Limiting & Timeouts
Implement maximum step counts and wall-clock timeouts. Prevent runaway loops by halting execution after a configurable number of actions or elapsed time.
En İyi Uygulamalar
Do
Use dedicated browser profiles for agent tasks
Implement human confirmation for irreversible actions
Log all screenshots and actions
Set maximum step limits (e.g., 50 actions)
Start with well-scoped, low-risk tasks
Validate the final state after completion
Don't
Give access to production accounts without oversight
Allow deletion or payment actions autonomously
Trust all page content as safe instructions
Run with admin/root privileges
Use on systems with sensitive personal data
Deploy without testing in a sandbox first
Ready to automate GUIs?
Start with a simple browser automation task in a sandboxed environment before scaling to more complex workflows.