AnthropicAdapter converts Anthropic computer actions to native desktop actions. It does not call the Anthropic API. Your application owns the model client, message history, policy, and limits.
Install the provider extra
ANTHROPIC_API_KEY in the application environment. Do not add the key to the Sandbox image.
Select a tool version
Use matching tool and beta versions.
The adapter defaults to
computer_20251124. Set enable_zoom=True to enable zoom for that version.
Declare the hosted tool
Anthropic owns the hostedcomputer tool schema. Do not add an input schema to it.
stop_reason is tool_use. Return all matching tool results together in the next user message.
Execute actions in order
Create the adapter once for the complete loop:screenshot or zoom. Return cursor coordinates as text. Capture one screenshot after another successful hosted action.
Use a batch tool only for fixed sequences
Your application can define a customcomputer_batch tool. Use it only when every action can run without an intermediate model decision.
All batch coordinates refer to the screenshot from before the batch. Execute actions sequentially. Stop on the first error.
Use the hosted computer tool for these cases:
- Exploratory navigation.
- Sensitive steps.
- Recovery after a failure.
- A step that depends on an intermediate screen.
Supported actions
All versions support mouse movement, clicks, drag, key input, typing, screenshots, and cursor position. The 2025 versions also support scroll, mouse down and up, held keys, wait, and triple click. Thecomputer_20251124 version supports zoom when you enable it.
The adapter rejects an action that the selected version does not support.
Bound the loop
Set limits for turns, trajectory actions, batch actions, action time, and elapsed time. Stop before you act when the final allowed turn requests another tool call. PassCoordinateSpace when the provider image size differs from the desktop size. The adapter then maps provider coordinates before execution.

