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 kernel = new Kernel();

// Delete a persisted browser
await kernel.browsers.delete({ persistent_id: 'persistent_id' });

// Delete a non-persisted browser
await kernel.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 kernel = new Kernel();
const kernelBrowser = await kernel.browsers.create({ timeout_seconds: 300 });