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:
import Kernel from '@onkernel/sdk';

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

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

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:
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);