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

# Quickstart

> Start using Browsernode with this quickstart guide

## Prepare the environment

* [Node.js](https://nodejs.org/en/download) (v20.19.4 or higher)
* npm (v10.9.0 or higher)

First, we recommend using [Node.js](https://nodejs.org/en/download) to setup the Node.js environment.

```bash theme={null}
npm init -y
```

Install the dependencies:

```bash theme={null}
npm install browsernode
```

Then install playwright:

```bash theme={null}
npx playwright install
```

## Create an agent

Then you can use the agent as follows:

```javascript theme={null}
import { Agent } from "browsernode";
import { ChatOpenAI } from "browsernode/llm";

const llm = new ChatOpenAI({
	model: "gpt-4.1",
	temperature: 0.0,
	apiKey: process.env.OPENAI_API_KEY,
});

const task = "Compare the price of gpt-4o and DeepSeek-V3";
const agent = new Agent(task, llm);
const history = await agent.run();
console.log(history.usage);
```

## Set up your LLM API keys

Add your API keys for the provider you want to use to your `.env` file.

```bash theme={null}
mv .env.example .env
```

`ChatOpenAI` and other Langchain chat models require API keys. You should store these in your `.env` file. For example, for OpenAI and Anthropic, you can set the API keys in your `.env` file, such as:

```bash .env theme={null}
OPENAI_API_KEY=
ANTHROPIC_API_KEY=
```

For other LLM models you can refer to the [Supported Models](/customize/supported-models) page to find how to set them up with their specific API keys.

## Run the example

```bash theme={null}
npx tsx examples/simple.ts
```
