Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Anthropics Anthropic sdk python BetaToolComputerUse 20250124

From Leeroopedia
Knowledge Sources
Domains API_Types, Beta_Features
Last Updated 2026-02-15 12:00 GMT

Overview

BetaToolComputerUse20250124Param is a TypedDict defining the parameter structure for the January 2025 version of the computer use tool. It specifies the display dimensions and configuration needed to enable the model to interact with a computer desktop environment.

Description

BetaToolComputerUse20250124Param is the second versioned iteration of the computer use tool. Its structure is identical to the October 2024 version (BetaToolComputerUse20241022Param) in terms of fields, but is identified by the type literal "computer_20250124". This version reflects API-level improvements and behavioral updates to the computer use capability.

This version supports the same configuration options as its predecessor:

  • Required fields: Display width/height in pixels, name (always "computer"), and type (always "computer_20250124")
  • Optional fields: Display number for X11 environments, cache control, deferred loading, allowed callers, input examples, and strict schema validation

Usage

Use BetaToolComputerUse20250124Param when you need to enable the January 2025 version of the computer use tool in a beta API request. This version supersedes the October 2024 version and should be preferred unless specific backward compatibility is needed. For the latest features including zoom support, consider the November 2025 version.

Code Reference

Source Location

  • Repository: Anthropic SDK Python
  • File: src/anthropic/types/beta/beta_tool_computer_use_20250124_param.py

Signature

class BetaToolComputerUse20250124Param(TypedDict, total=False):
    display_height_px: Required[int]
    display_width_px: Required[int]
    name: Required[Literal["computer"]]
    type: Required[Literal["computer_20250124"]]
    allowed_callers: List[Literal["direct", "code_execution_20250825"]]
    cache_control: Optional[BetaCacheControlEphemeralParam]
    defer_loading: bool
    display_number: Optional[int]
    input_examples: Iterable[Dict[str, object]]
    strict: bool

Import

from anthropic.types.beta import BetaToolComputerUse20250124Param

I/O Contract

Field Type Required Description
display_height_px int Yes The height of the display in pixels
display_width_px int Yes The width of the display in pixels
name Literal["computer"] Yes Tool name; always "computer"
type Literal["computer_20250124"] Yes Tool version identifier
allowed_callers List[Literal["direct", "code_execution_20250825"]] No Which callers may invoke this tool
cache_control Optional[BetaCacheControlEphemeralParam] No Cache control breakpoint for this tool definition
defer_loading bool No If true, tool is not included in initial system prompt
display_number Optional[int] No X11 display number (e.g., 0, 1)
input_examples Iterable[Dict[str, object]] No Example inputs for the tool
strict bool No When true, guarantees schema validation on tool names and inputs

Usage Examples

Basic Computer Use Tool Definition

from anthropic.types.beta import BetaToolComputerUse20250124Param

tool: BetaToolComputerUse20250124Param = {
    "type": "computer_20250124",
    "name": "computer",
    "display_width_px": 1920,
    "display_height_px": 1080,
}

With X11 Display and Cache Control

from anthropic.types.beta import BetaToolComputerUse20250124Param

tool: BetaToolComputerUse20250124Param = {
    "type": "computer_20250124",
    "name": "computer",
    "display_width_px": 1920,
    "display_height_px": 1080,
    "display_number": 0,
    "cache_control": {"type": "ephemeral"},
}

Passing to the API

import anthropic

client = anthropic.Anthropic()

message = client.beta.messages.create(
    model="claude-sonnet-4-20250514",
    max_tokens=1024,
    tools=[
        {
            "type": "computer_20250124",
            "name": "computer",
            "display_width_px": 1920,
            "display_height_px": 1080,
        }
    ],
    messages=[{"role": "user", "content": "Open a web browser and navigate to example.com."}],
    betas=["computer-use-2025-01-24"],
)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment