Capture screenshots
Return a screenshot after the action batch finishes. When the model needs visual context before acting, it can first request a screenshot:
Screenshot request
{
"output": [
{
"type": "computer_call",
"call_id": "call_001",
"actions": [
{ "type": "screenshot" }
],
"status": "completed"
}
]
}Capture the screen from the environment used by your action handler:
Playwright
Capture a screenshot
async function captureScreenshot(page) {
return await page.screenshot({ type: "png" });
}def capture_screenshot(page):
return page.screenshot(type="png")Docker
Capture a screenshot
async function captureScreenshot(vm) {
return await dockerExec(
vm.containerName,
"import",
["-window", "root", "png:-"],
{ decode: false, env: { DISPLAY: vm.display } }
);
}def capture_screenshot(vm):
return docker_exec(
f"export DISPLAY={vm.display} && import -window root png:-",
vm.container_name,
decode=False,
)For Computer use, prefer detail: "original" on screenshot inputs to preserve resolution and improve click accuracy. Large screenshots can use more input tokens, and original can still resize images that exceed the model's dimension limits. For patch-based image inputs, the API rejects screenshots that still exceed the 30,000-patch limit after resizing. It does not resize them to fit that limit. If detail: "original" uses too many tokens or exceeds the limit, downscale the image before sending it to the API, and make sure you remap model-generated coordinates from the downscaled coordinate space to the original image's coordinate space. Avoid using high or low image detail for computer use tasks. When downscaling, we observe strong performance with 1440x900 and 1600x900 desktop resolutions. See the Images and Vision guide for the limits that apply to each model.