"computer-use-2025-01-24"
(Claude 4 and 3.7 models)"computer-use-2024-10-22"
(Claude Sonnet 3.5)Model | Tool Version | Beta Flag |
---|---|---|
Claude 4 models | computer_20250124 | computer-use-2025-01-24 |
Claude Sonnet 3.7 | computer_20250124 | computer-use-2025-01-24 |
Claude Sonnet 3.5 (new) | computer_20241022 | computer-use-2024-10-22 |
1. Provide Claude with the computer use tool and a user prompt
2. Claude decides to use the computer use tool
stop_reason
of tool_use
, signaling Claude’s intent.3. Extract tool input, evaluate the tool on a computer, and return results
user
message containing a tool_result
content block.4. Claude continues calling computer use tools until it's completed the task
tool_use
stop_reason
and you should return to step 3.Claude 4 models
computer_20250124
, include this beta flag:Claude Sonnet 3.7
computer_20250124
, include this beta flag:Claude Sonnet 3.5 (new)
computer_20241022
, include this beta flag:After each step, take a screenshot and carefully evaluate if you have achieved the right outcome. Explicitly show your thinking: "I have evaluated step X..." If not correct, try again. Only when you confirm a step was executed correctly should you move on to the next one.
<robot_credentials>
. Using computer use within applications that require login increases the risk of bad outcomes as a result of prompt injection. Please review our guide on mitigating prompt injections before providing the model with login credentials.You have access to a set of functions you can use to answer the user’s question. This includes access to a sandboxed computing environment. You do NOT currently have the ability to inspect files or interact with external resources, except by invoking the below functions.As with regular tool use, the user-provided
system_prompt
field is still respected and used in the construction of the combined system prompt.
[x, y]
computer_20250124
)
Available in Claude 4 and Claude Sonnet 3.7:
Example actions
Parameter | Required | Description |
---|---|---|
type | Yes | Tool version (computer_20250124 or computer_20241022 ) |
name | Yes | Must be “computer” |
display_width_px | Yes | Display width in pixels |
display_height_px | Yes | Display height in pixels |
display_number | No | Display number for X11 environments |
thinking
parameter to your API request:
budget_tokens
parameter specifies how many tokens Claude can use for thinking. This is subtracted from your overall max_tokens
budget.
When thinking is enabled, Claude will return its reasoning process as part of the response, which can help you:
tool_use
results using your tool implementationsSet up your computing environment
Implement action handlers
Process Claude's tool calls
Implement the agent loop
Screenshot capture failure
Invalid coordinates
Action execution failure
Use appropriate display resolution
Implement proper screenshot handling
Add action delays
Validate actions before execution
Log actions for debugging
left_mouse_down
, left_mouse_up
, and new modifier key support. Cell selection can be more reliable by using these fine-grained controls and combining modifier keys with clicks.Model | Input tokens per tool definition |
---|---|
Claude 4 / Sonnet 3.7 | 735 tokens |
Claude Sonnet 3.5 | 683 tokens |