> For the complete documentation index, see [llms.txt](https://docs.toystack.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.toystack.ai/virtual-os/getting-started.md).

# Getting Started

## Deploy your instance

**Step-1**

Generate API key

Sign up on our [dashboard](https://dashboard.toystack.ai/). An API key will be generated for you automatically.

**Step-2**

Install SDK

Install the Python SDK with pip.

```
pip install toystack-virtual-os
```

**Step-3**

Configure client

Configure the client with your API key.

```python
from toystack import ToystackVirtualOs

client = ToystackVirtualOs(api_key="your_api_key")

```

**Step-4**

Start instance of virtual os

```python
instance = client.start(instance_type="virtual_os" )
```

#### **Interact with the Instance**

You can interact with your ToyStack Virtual OS instance using various tools such as `screenshot`, `bash`, `computer`, and `edit`. Below are examples of how to perform common actions:

```python
# Get the status of the instance
status = instance.get_status()

# Get the streaming URL for interacting with the instance
stream_url = instance.get_stream_url()

# Capture a screenshot of the current instance view
base_64_image = instance.screenshot()

# Move the mouse cursor to specific coordinates
result = instance.computer(
    action="mouse_move",
    coordinate=[200, 100]
)

# Perform a left-click action
result = instance.computer(
    action="left_click"
)

# Execute a bash command within the instance
result = instance.bash(
    command="ls -la"
)
```

***

#### **Integrate with Claude (Optional)**

You can optionally connect **Claude Computer Use** to your ToyStack Virtual OS instance using `BashTool`, `ComputerTool`, `EditTool`, and `ToolResult`.

```python
from toystack.tools import BashTool, ComputerTool, EditTool, ToolResult
from anthropic import Anthropic

# ToolCollection definition omitted for brevity; see full example

tool_collection = ToolCollection(
    ComputerTool(instance),
    BashTool(instance),
    EditTool(instance)
)

# Initialize Anthropic Client
anthropic_client = Anthropic(api_key="your_api_key")

# Send a message with tools enabled
response = anthropic_client.beta.messages.create(
    model="claude-3-5-sonnet-20241022",
    max_tokens=4096,
    messages=messages,
    system=[{"type": "text", "text": SYSTEM_PROMPT}],
    tools=tool_collection.to_params(),
    betas=["computer-use-2024-10-22"]
)
```

> **Note:** This is an optional integration. If you are using Claude's Computer Use, ensure you have the correct API keys and configurations.

***

#### **Stop the Instance**

When you are done with your session, it is recommended to stop the instance. This action will delete all data stored during the session.

```python
# Stop the instance
instance.stop()
```

***

#### **Upcoming Features**

ToyStack is actively developing additional features to support **desktop AI agents** and enhanced tooling within the Virtual OS. Stay tuned for updates as these features are rolled out in future releases
