This feature is coming soon!

Kernel makes it possible to persist and reuse the same browser state across multiple invocations. In between invocations, the browser goes into standby, consuming no usage costs when they do. Browsers not marked for persistence are automatically terminated after your action calls browser.close().

To terminate a persisted browser, delete it using the browser ID that you specified when creating the browser with persistence:

kernel browser terminate <browser_id>

You can also do this by making a DELETE request to Kernel’s API:

const response = await fetch(`https://api.onkernel.com/browsers/${browserId}`, {
    method: 'DELETE',
    headers: {
        'Authorization': `Bearer ${process.env.KERNEL_API_KEY}`,
        'Content-Type': 'application/json'
    }
});

Or via the SDK:

import { Kernel } from '@onkernel/sdk';

await Kernel.browsers.delete(browserId);