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

# Quick start

> Run a hosted agent or launch a cloud browser.

<CardGroup cols={2}>
  <Card title="Hosted Agents" icon="robot" href="/cloud/agent/quickstart">
    Give an agent a task and get the result.
  </Card>

  <Card title="Browsers" icon="globe" href="/cloud/browser/quickstart">
    Launch a cloud browser and connect to it from your code.
  </Card>
</CardGroup>

Get an [API key](https://cloud.browser-use.com/settings?tab=api-keys\&new=1) and
export it:

```bash theme={null}
export BROWSER_USE_API_KEY=your_key
```

## Install the SDK

Skip this step if you use curl.

<CodeGroup>
  ```bash Python theme={null}
  pip install browser-use-sdk
  ```

  ```bash TypeScript theme={null}
  npm install browser-use-sdk
  ```
</CodeGroup>

## Run a hosted agent

<CodeGroup>
  ```python Python theme={null}
  from browser_use_sdk.v4 import BrowserUse

  client = BrowserUse()
  run = client.runs.create(
      "Find the top Hacker News story",
      model="grok-4.5",
  )
  run = client.runs.wait_for_completion(run.id)
  print(run.result)
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v4";

  const client = new BrowserUse();
  const run = await client.runs.create({
    task: "Find the top Hacker News story",
    model: "grok-4.5",
  });
  const result = await client.runs.waitForCompletion(run.id);
  console.log(result.result);
  ```

  ```bash curl theme={null}
  curl https://api.browser-use.com/api/v4/runs \
    -H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"task":"Find the top Hacker News story","model":"grok-4.5"}'
  ```
</CodeGroup>

## Control a browser

Launch a browser, connect to its CDP URL, then stop it:

<CodeGroup>
  ```python Python theme={null}
  from browser_use_sdk.v3 import BrowserUse

  client = BrowserUse()
  browser = client.browsers.create(proxy_country_code="us")
  print(browser.cdp_url)

  # When finished:
  client.browsers.stop(browser.id)
  ```

  ```typescript TypeScript theme={null}
  import { BrowserUse } from "browser-use-sdk/v3";

  const client = new BrowserUse();
  const browser = await client.browsers.create({ proxyCountryCode: "us" });
  console.log(browser.cdpUrl);

  // When finished:
  await client.browsers.stop(browser.id);
  ```

  ```bash curl theme={null}
  browser=$(curl -sS https://api.browser-use.com/api/v4/browsers \
    -H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"proxyCountryCode":"us"}')

  export BROWSER_SESSION_ID=$(echo "$browser" | jq -r .id)
  export BROWSER_USE_CDP_URL=$(echo "$browser" | jq -r .cdpUrl)

  # Connect Playwright or Puppeteer to $BROWSER_USE_CDP_URL, then stop:
  curl -X PATCH \
    "https://api.browser-use.com/api/v4/browsers/$BROWSER_SESSION_ID" \
    -H "X-Browser-Use-API-Key: $BROWSER_USE_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"action":"stop"}'
  ```
</CodeGroup>

<Warning>
  Closing Playwright, Puppeteer, or CDP does not stop the browser. Use
  `client.browsers.stop(browser.id)` or call `PATCH /api/v4/browsers/{id}` with
  `{"action":"stop"}`.
</Warning>

<Card title="Copy for an LLM" icon="sparkles" href="/cloud/llms.txt">
  Give your coding agent the compact API V4 context.
</Card>
