> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-hypeship-update-create-pool-guidance.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Create

> Spin up a cloud browser for your agent

Kernel browsers are sandboxed Chromium instances that boot in under 30ms. Your agent creates them on demand, drives them, and tears them down — no infra to provision, no servers to run.

## Your first browser

<Info>
  Install the Kernel SDK first:

  * Typescript/Javascript: `npm install @onkernel/sdk`
  * Python: `pip install kernel`
  * Go: `go get github.com/kernel/kernel-go-sdk`
</Info>

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  import Kernel from '@onkernel/sdk';

  const kernel = new Kernel();

  const kernelBrowser = await kernel.browsers.create();
  console.log(kernelBrowser.session_id);
  ```

  ```python Python theme={null}
  from kernel import Kernel

  kernel = Kernel()

  kernel_browser = kernel.browsers.create()
  print(kernel_browser.session_id)
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"

  	"github.com/kernel/kernel-go-sdk"
  )

  func main() {
  	ctx := context.Background()
  	client := kernel.NewClient()

  	kernelBrowser, err := client.Browsers.New(ctx, kernel.BrowserNewParams{})
  	if err != nil {
  		panic(err)
  	}

  	fmt.Println(kernelBrowser.SessionID)
  }
  ```

  ```bash CLI theme={null}
  kernel browsers create

  # or with a starting URL and stealth
  kernel browsers create --stealth --start-url https://example.com
  ```
</CodeGroup>

The response includes everything you need to drive the browser: `session_id`, `cdp_ws_url`, `webdriver_ws_url`, and `browser_live_view_url`.

If your environment restricts outbound traffic, add Kernel's [domains and ports](/info/network-access) to its allowlist.

## Pick the right shape

Most of what you'll tune at creation time falls into four buckets:

<Columns cols={2}>
  <Card title="Headless vs headful" href="/browsers/headless">
    headful (default) supports live view, replays, and better stealth — ideal for agent workflows on bot-detected sites. headless is lighter (1 gb vs 8 gb), good for simple scraping.
  </Card>

  <Card title="Stealth and proxies" href="/browsers/bot-detection/overview">
    Turn on stealth mode and route through residential, ISP, or datacenter proxies when you're hitting sites with bot detection.
  </Card>

  <Card title="GPU acceleration" href="/browsers/gpu-acceleration">
    Required for WebGL, video, and canvas-heavy workloads. Trades off standby support.
  </Card>

  <Card title="Profiles and auth" href="/browsers/profiles">
    Persist cookies, storage, and authenticated sessions across runs with a [profile](/browsers/profiles), or learn how to hand supported login flows off to Kernel with [Managed Auth](/auth/managed-auth).
  </Card>
</Columns>

## On demand or from a pool

`browsers.create()` boots a browser for you on the spot. It's the default while you're building, and it stays the right fit when your configuration changes per user as you scale.

A [browser pool](/browsers/pools) keeps browsers already booted on one fixed configuration, so `acquire` hands you one that's ready to drive. Consider one once you've built and scaled your workload and every run uses the same attributes, or when you need to acquire browsers faster than the [rate limit](/info/pricing#rate-limiting) on `browsers.create()` allows. See [Scale](/introduction/scale) to decide which fits your workload.

<Info>
  If you're on an Enterprise plan, speak with your account manager about applicable rate limits for `browsers.create()` and what's best for your workloads.
</Info>

## Lifecycle

A browser stays alive as long as something is driving it — a CDP or WebDriver client, a [Live View](/browsers/live-view) viewer, or an in-flight [computer controls](/browsers/computer-controls) request. After five seconds with none of those active, it enters [standby](/browsers/standby) — state is preserved, billing stops. Once in standby, after the configurable timeout (60s by default) elapses it's deleted.

We recommend you delete a browser explicitly when you're done with it:

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  await kernel.browsers.deleteByID(kernelBrowser.session_id);
  ```

  ```python Python theme={null}
  kernel.browsers.delete_by_id(kernel_browser.session_id)
  ```

  ```go Go theme={null}
  if err := client.Browsers.DeleteByID(ctx, kernelBrowser.SessionID); err != nil {
  	panic(err)
  }
  ```

  ```bash CLI theme={null}
  kernel browsers delete <session-id>
  ```
</CodeGroup>

See [Termination & timeouts](/browsers/termination#automatic-deletion-via-timeout) for the full set of teardown options.

## Full example

Putting it together — create a browser, run Playwright code inside it, tear down:

<CodeGroup>
  ```typescript Typescript/Javascript theme={null}
  import Kernel from '@onkernel/sdk';

  const kernel = new Kernel();

  const kernelBrowser = await kernel.browsers.create();

  try {
    const response = await kernel.browsers.playwright.execute(
      kernelBrowser.session_id,
      {
        code: `
          await page.goto('https://www.onkernel.com');
          return await page.title();
        `,
      },
    );
    console.log(response.result);
  } catch (error) {
    console.error(error);
  } finally {
    await kernel.browsers.deleteByID(kernelBrowser.session_id);
  }
  ```

  ```python Python theme={null}
  from kernel import Kernel

  kernel = Kernel()

  kernel_browser = kernel.browsers.create()

  try:
      response = kernel.browsers.playwright.execute(
          id=kernel_browser.session_id,
          code="""
            await page.goto('https://www.onkernel.com')
            return await page.title()
          """,
      )
      print(response.result)
  except Exception as e:
      print(e)
  finally:
      kernel.browsers.delete_by_id(kernel_browser.session_id)
  ```

  ```go Go theme={null}
  package main

  import (
  	"context"
  	"fmt"

  	"github.com/kernel/kernel-go-sdk"
  )

  func main() {
  	ctx := context.Background()
  	client := kernel.NewClient()

  	kernelBrowser, err := client.Browsers.New(ctx, kernel.BrowserNewParams{})
  	if err != nil {
  		panic(err)
  	}
  	defer func() {
  		if err := client.Browsers.DeleteByID(ctx, kernelBrowser.SessionID); err != nil {
  			panic(err)
  		}
  	}()

  	response, err := client.Browsers.Playwright.Execute(
  		ctx,
  		kernelBrowser.SessionID,
  		kernel.BrowserPlaywrightExecuteParams{
  			Code: `
  				await page.goto('https://www.onkernel.com');
  				return await page.title();
  			`,
  		},
  	)
  	if err != nil {
  		panic(err)
  	}

  	fmt.Println(response.Result)
  }
  ```
</CodeGroup>

## What's next

Once you have a browser, you need to drive it. Head to [Control](/introduction/control) to see the four primitives Kernel exposes — computer use, playwright execution, CDP, and WebDriver BiDi — and when to reach for each.

To carry cookies, site data, tabs, and preferences into later runs, use [Browser Profiles](/browsers/profiles). Profiles can resume an agent workflow, maintain one identity per user or account, or give parallel workers the same read-only starting state.

When you're ready to run this in production, [Scale](/introduction/scale) covers whether to keep creating browsers on demand or serve your workload from a [browser pool](/browsers/pools), and the architecture patterns for each.
