---
title: "Computer Use"
url: "/docs/completion/computer_use"
canonical_url: "https://docs.litellm.ai/docs/completion/computer_use"
type: "docs"
last_updated: "2026-10-08"
summary: "Computer use allows models to interact with computer interfaces by taking screenshots and performing actions like clicking, typing, and scrolling. This enables AI models to autonomously operate desktop environments."
related:
  - "/docs/completion/web_fetch"
  - "/docs/guides/code_interpreter"
---
# Computer Use

> Index of all LiteLLM docs: https://docs.litellm.ai/llms.txt


Computer use allows models to interact with computer interfaces by taking screenshots and performing actions like clicking, typing, and scrolling. This enables AI models to autonomously operate desktop environments.

**Supported Providers:**
- Anthropic API (`anthropic/`)
- Bedrock (Anthropic) (`bedrock/`)
- Vertex AI (Anthropic) (`vertex_ai/`)

**Supported Tool Types:**
- `computer` - Computer interaction tool with display parameters
- `bash` - Bash shell tool  
- `text_editor` - Text editor tool
- `web_search` - Web search tool

LiteLLM will standardize the computer use tools across all supported providers.

## Quick Start

**LiteLLM Python SDK**

```python keep-model-ids
import os 
from litellm import completion

os.environ["ANTHROPIC_API_KEY"] = "your-api-key"

# Computer use tool
tools = [
    {
        "type": "computer_20241022",
        "name": "computer",
        "display_height_px": 768,
        "display_width_px": 1024,
        "display_number": 0,
    }
]

messages = [
    {
        "role": "user", 
        "content": [
            {
                "type": "text",
                "text": "Take a screenshot and tell me what you see"
            },
            {
                "type": "image_url",
                "image_url": {
                    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
                }
            }
        ]
    }
]

response = completion(
    model="anthropic/claude-3-5-sonnet-latest",
    messages=messages,
    tools=tools,
)

print(response)
```

**LiteLLM Proxy Server**

1. Define computer use models on config.yaml

```yaml keep-model-ids
model_list:
  - model_name: claude-3-5-sonnet-latest # Anthropic claude-3-5-sonnet-latest
    litellm_params:
      model: anthropic/claude-3-5-sonnet-latest
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: claude-bedrock         # Bedrock Anthropic model
    litellm_params:
      model: bedrock/us.anthropic.claude-3-5-sonnet-20241022-v2:0
      aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID
      aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY
      aws_region_name: us-west-2
    model_info:
      supports_computer_use: True        # set supports_computer_use to True so /model/info returns this attribute as True
```

2. Run proxy server

```bash
litellm --config config.yaml
```

3. Test it using the OpenAI Python SDK

```python keep-model-ids
import os 
from openai import OpenAI

client = OpenAI(
    api_key="sk-<your-litellm-api-key>", # your litellm proxy api key
    base_url="http://0.0.0.0:4000"
)

response = client.chat.completions.create(
    model="claude-3-5-sonnet-latest",
    messages=[
        {
            "role": "user", 
            "content": [
                {
                    "type": "text",
                    "text": "Take a screenshot and tell me what you see"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
                    }
                }
            ]
        }
    ],
    tools=[
        {
            "type": "computer_20241022",
            "name": "computer",
            "display_height_px": 768,
            "display_width_px": 1024,
            "display_number": 0,
        }
    ]
)

print(response)
```

## Checking if a model supports `computer use`

**LiteLLM Python SDK**

Use `supports_computer_use(model="")` from `litellm.utils` -> returns `True` if model supports computer use and `False` if not. It is not exported on the top-level `litellm` package, so `litellm.supports_computer_use` raises `AttributeError`

```python
from litellm.utils import supports_computer_use

assert supports_computer_use(model="anthropic/claude-sonnet-5") == True
assert supports_computer_use(model="anthropic/claude-opus-5") == True
assert supports_computer_use(model="bedrock/us.anthropic.claude-sonnet-5") == True
assert supports_computer_use(model="vertex_ai/claude-sonnet-5") == True
assert supports_computer_use(model="openai/gpt-5.6-terra") == False
```

**LiteLLM Proxy Server**

1. Define computer use models on config.yaml

```yaml
model_list:
  - model_name: claude-sonnet          # Anthropic model, supports_computer_use comes from the model cost map
    litellm_params:
      model: anthropic/claude-sonnet-5
      api_key: os.environ/ANTHROPIC_API_KEY
  - model_name: claude-bedrock         # Bedrock Anthropic model
    litellm_params:
      model: bedrock/us.anthropic.claude-3-5-sonnet-20241022-v2:0
      aws_access_key_id: os.environ/AWS_ACCESS_KEY_ID
      aws_secret_access_key: os.environ/AWS_SECRET_ACCESS_KEY
      aws_region_name: us-west-2
    model_info:
      supports_computer_use: True        # set supports_computer_use to True so /model/info returns this attribute as True
```

2. Run proxy server

```bash
litellm --config config.yaml
```

3. Call `/model/info` to check if your model supports `computer use`. The flag is on each deployment's `model_info`. `/model_group/info` does not return `supports_computer_use`

```shell
curl -X 'GET' \
  'http://localhost:4000/model/info' \
  -H 'accept: application/json' \
  -H "x-api-key: $LITELLM_API_KEY"
```

Expected Response (trimmed)

```json
{
  "data": [
    {
      "model_name": "claude-sonnet",
      "litellm_params": {"model": "anthropic/claude-sonnet-5"},
      "model_info": {
        "litellm_provider": "anthropic",
        "mode": "chat",
        "supports_computer_use": true,
        "supports_vision": true,
        "supports_function_calling": true
      }
    },
    {
      "model_name": "claude-bedrock",
      "litellm_params": {"model": "bedrock/us.anthropic.claude-3-5-sonnet-20241022-v2:0"},
      "model_info": {
        "litellm_provider": "bedrock",
        "mode": "chat",
        "supports_computer_use": true,
        "supports_vision": true,
        "supports_function_calling": true
      }
    }
  ]
}
```

## Different Tool Types

Computer use supports several different tool types for various interaction modes:

**Computer Tool**

The `computer_20241022` tool provides direct screen interaction capabilities.

```python keep-model-ids
import os 
from litellm import completion

os.environ["ANTHROPIC_API_KEY"] = "your-api-key"

tools = [
    {
        "type": "computer_20241022", 
        "name": "computer",
        "display_height_px": 768,
        "display_width_px": 1024,
        "display_number": 0,
    }
]

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "text", 
                "text": "Click on the search button in the screenshot"
            },
            {
                "type": "image_url",
                "image_url": {
                    "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
                }
            }
        ]
    }
]

response = completion(
    model="anthropic/claude-3-5-sonnet-latest",
    messages=messages,
    tools=tools,
)

print(response)
```

**Bash Tool**

The `bash_20241022` tool provides command line interface access.

```python keep-model-ids
import os 
from litellm import completion

os.environ["ANTHROPIC_API_KEY"] = "your-api-key"

tools = [
    {
        "type": "bash_20241022",
        "name": "bash"
    }
]

messages = [
    {
        "role": "user",
        "content": "List the files in the current directory using bash"
    }
]

response = completion(
    model="anthropic/claude-3-5-sonnet-latest",
    messages=messages,
    tools=tools,
)

print(response)
```

**Text Editor Tool**

The `text_editor_20250124` tool provides text file editing capabilities.

```python keep-model-ids
import os 
from litellm import completion

os.environ["ANTHROPIC_API_KEY"] = "your-api-key"

tools = [
    {
        "type": "text_editor_20250124",
        "name": "str_replace_editor"
    }
]

messages = [
    {
        "role": "user",
        "content": "Create a simple Python hello world script"
    }
]

response = completion(
    model="anthropic/claude-3-5-sonnet-latest",
    messages=messages,
    tools=tools,
)

print(response)
```

## Advanced Usage with Multiple Tools

You can combine different computer use tools in a single request:

```python keep-model-ids
import os 
from litellm import completion

os.environ["ANTHROPIC_API_KEY"] = "your-api-key"

tools = [
    {
        "type": "computer_20241022",
        "name": "computer", 
        "display_height_px": 768,
        "display_width_px": 1024,
        "display_number": 0,
    },
    {
        "type": "bash_20241022",
        "name": "bash"
    },
    {
        "type": "text_editor_20250124", 
        "name": "str_replace_editor"
    }
]

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "text",
                "text": "Take a screenshot, then create a file describing what you see, and finally use bash to show the file contents"
                },
                {
                    "type": "image_url",
                    "image_url": {
                        "url": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg=="
                    }
                }
            ]
        }
    ]
    
response = completion(
    model="anthropic/claude-3-5-sonnet-latest",
            messages=messages,
            tools=tools,
)

print(response)
```

## Spec

### Computer Tool (`computer_20241022`)

```json
{
  "type": "computer_20241022",
  "name": "computer",
  "display_height_px": 768,    // Required: Screen height in pixels  
  "display_width_px": 1024,    // Required: Screen width in pixels
  "display_number": 0          // Optional: Display number (default: 0)
}
```

### Bash Tool (`bash_20241022`)

```json
{
  "type": "bash_20241022", 
  "name": "bash"              // Required: Tool name
}
```

### Text Editor Tool (`text_editor_20250124`)

```json
{
  "type": "text_editor_20250124",
  "name": "str_replace_editor"  // Required: Tool name
}
```

### Web Search Tool (`web_search_20250305`)

```json
{
  "type": "web_search_20250305",
  "name": "web_search"         // Required: Tool name
}
```

## Related pages

- [Web Fetch](https://docs.litellm.ai/docs/completion/web_fetch.md)
- [Code Interpreter](https://docs.litellm.ai/docs/guides/code_interpreter.md)
