> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browserbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenAI Computer Use Agent

> Integrate OpenAI CUA with Browserbase for scalable browser agents

This guide walks you through integrating OpenAI's Computer Use Agent (CUA) with Browserbase for scalable cloud browser agents.

CUA is an AI model that can see the screen, understand context, and take actions within a browser — enabling advanced interaction with web applications. Pair CUA with Browserbase's scalable remote browser infrastructure to run AI-powered browser agents effortlessly in the cloud.

Try out the Computer Use Agent now: [cua.browserbase.com](https://cua.browserbase.com/)

## Prerequisites

* OpenAI API key with Computer Use Agent access
* Browserbase account and API key
* Python 3.8+

## Basic integration

This basic setup will get you up and running with a CUA agent using Browserbase as the underlying browser automation platform.

<Steps>
  <Step title="Clone the repository">
    ```bash theme={null}
    git clone https://github.com/openai/openai-cua-sample-app.git
    ```
  </Step>

  <Step title="Install the required packages">
    ```bash theme={null}
    pip install -r "requirements.txt"
    ```
  </Step>

  <Step title="Set the environment variables">
    ```bash theme={null}
    BROWSERBASE_API_KEY=YOUR_API_KEY
    OPENAI_API_KEY=YOUR_OPENAI_API_KEY
    OPENAI_ORG=YOUR_OPENAI_ORG
    ```
  </Step>

  <Step title="Run the agent">
    Update the prompt in your cli to change the behavior of the agent

    ```bash theme={null}
    python cli.py --computer browserbase --input "go to hackernews, tell me the top news"
    ```
  </Step>
</Steps>

## Customizing the CUA agent

You can customize the CUA agent by updating the flags in the CLI:

* `--input`: The initial input to the agent (optional: the CLI will prompt you for input if not provided)
* `--debug`: Enable debug mode.
* `--show`: Show images (screenshots) during the execution.
* `--start-url`: Start the browsing session with a specific URL (only for browser environments). By default, the CLI will start the browsing session with `https://bing.com`.

## Related resources

<CardGroup cols={3}>
  <Card title="Browserbase documentation" icon="book" href="https://docs.browserbase.com">
    Explore the full Browserbase documentation
  </Card>

  <Card title="OpenAI API documentation" icon="code" href="https://platform.openai.com/docs">
    Learn more about OpenAI's APIs
  </Card>

  <Card title="Example projects on GitHub" icon="github" href="https://github.com/openai/openai-cua-sample-app.git">
    Find the sample project for this integration
  </Card>
</CardGroup>
