> ## Documentation Index
> Fetch the complete documentation index at: https://modal-computer-use.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Build computer-use agents on Modal

> Run a Linux desktop in a Modal Sandbox and control it with Python.

Modal Computer Use gives Python applications a Linux desktop with screenshots, native input,
browser control, commands, and artifacts. The desktop runs in a Modal Sandbox. A colocated Modal
Function runs your model loop.

<CardGroup cols={3}>
  <Card title="Quickstart" href="/start/quickstart" icon="bolt">
    Create a desktop and run your first placed trajectory.
  </Card>

  <Card title="OpenAI" href="/integrate/openai" icon="brain">
    Connect the Responses API to the computer.
  </Card>

  <Card title="Anthropic" href="/integrate/anthropic" icon="message">
    Connect the Messages API to the computer.
  </Card>
</CardGroup>

## Write the model loop

Your application owns model calls and conversation state. Borrow the desktop once, then use
`computer.step()` for each ordered action array.

```python theme={"system"}
async with handle.borrow_async(
    run_id=run_id,
    function_region="us-west-2",
) as computer:
    screenshot = await computer.screenshots.full()

    while task_is_running:
        actions = await call_model(screenshot)
        result = await computer.step(actions)
        screenshot = result.screenshot
```

Step validates the complete array before mutation, runs the actions in order, and returns the action
results with an immediate screenshot. Your application decides when the target application is
ready and whether the task succeeded.

## Keep the trajectory close to the desktop

1. Create the desktop once with an async owner.
2. Send its session handle to a Function that declares the same supported region selector.
3. Keep one borrow and one pooled client for the model loop.
4. Release the borrow before the owner closes the desktop.

The [quickstart](/start/quickstart) shows the complete owner, Function, and cleanup flow.

## Choose a guide

<CardGroup cols={2}>
  <Card title="Install the SDK" href="/start/installation" icon="download">
    Install the package and set up Modal credentials.
  </Card>

  <Card title="Control the browser" href="/build/browser-automation" icon="browser">
    Open pages, inspect browser status, and choose an Image.
  </Card>

  <Card title="Deploy the application" href="/operate/deploy" icon="cloud-arrow-up">
    Set placement, resources, ownership, and cleanup.
  </Card>

  <Card title="Browse the API" href="/reference/overview" icon="code">
    Find SDK entry points, namespaces, models, and daemon routes.
  </Card>
</CardGroup>

Modal Computer Use is independently maintained and uses Modal as its runtime.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.