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

# Node Targeting

> Reuse a specific hosted node for a browser session.

Driver creates hosted sessions automatically. Most users should only pass `type: "hosted"`.

Use `nodeId` only when you need a later session to run on the same hosted node that served a previous session.

## Reuse a Hosted Node

Every session response includes `servedBy`. Pass that value as `nodeId` in a later session:

<CodeGroup>
  ```typescript TypeScript theme={null}
  const firstSession = await client.browser.session.create({ type: "hosted" });

  await client.browser.session.stop({ sessionId: firstSession.sessionId });

  const nextSession = await client.browser.session.create({
    type: "hosted",
    nodeId: firstSession.servedBy,
  });
  ```

  ```python Python theme={null}
  import os
  import requests

  headers = {
      "Authorization": f"Bearer {os.getenv('DRIVER_API_KEY')}",
      "Content-Type": "application/json",
  }

  first_resp = requests.post(
      "https://api.driver.dev/v1/browser/session",
      headers=headers,
      json={"type": "hosted"},
  )
  first_resp.raise_for_status()
  first_session = first_resp.json()

  requests.delete(
      "https://api.driver.dev/v1/browser/session",
      headers=headers,
      params={"sessionId": first_session["sessionId"]},
  )

  next_resp = requests.post(
      "https://api.driver.dev/v1/browser/session",
      headers=headers,
      json={"type": "hosted", "nodeId": first_session["servedBy"]},
  )
  next_resp.raise_for_status()
  next_session = next_resp.json()
  ```
</CodeGroup>

<Warning>
  `nodeId` overrides `country`. If the hosted node is unavailable, the request fails instead of falling back to another node.
</Warning>
