> ## Documentation Index
> Fetch the complete documentation index at: https://tbd-6fc993ce-mason-add-copy-page-to-context-menu.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Termination & Timeouts

Kernel browsers should be terminated after you're done with them.

## Via API

You can delete a browser by making a `DELETE` request to Kernel's API:

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

  const client = new Kernel({
    apiKey: 'My API Key',
  });

  await client.browsers.deleteByID('htzv5orfit78e1m2biiifpbv');
  ```

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

  client = Kernel(
      api_key="My API Key",
  )
  client.browsers.delete_by_id(
      "htzv5orfit78e1m2biiifpbv",
  )
  ```
</CodeGroup>

## Timeouts for non-persisted browsers

If you don't manually delete a `non-persisted` browser, deletion will happen automatically after a configurable `timeout` (default 60 seconds). If the browser does not see a CDP or live view connection within that timeout, then it is automatically deleted.

You can set a custom timeout of up to 24 hours via the API:

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

  const client = new Kernel({
    apiKey: 'My API Key',
  });

  const browser = await client.browsers.create({timeout_seconds: 300 });

  console.log(browser.session_id);
  ```

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

  client = Kernel(
      api_key="My API Key",
  )
  browser = client.browsers.create(timeout_seconds=300)
  print(browser.session_id)
  ```
</CodeGroup>
