Overview

Sessions are the heart of the Notte ecosystem. They maintain browser states and manage interactions so you can use them to perform tasks. Every other operation in the Notte ecosystem is performed on behalf of a session, whether it’s an agent run, a page interaction, or a vault operation.

Session Management

Python SDK

The following snippet shows how to manage your browser sessions using the Notte Python SDK.

from notte_sdk import NotteClient

notte = NotteClient()
# The session is automatically stopped when the context manager is exited
with notte.Session(timeout_minutes=2) as session:  
	status = session.status()
	print(status)

Key points

  • Session Lifecycle: If you are using the stateless API, remember to manually stop all sessions that you started. You can check active sessions using notte.sessions.list().
  • Timeouts: Use the timeout_minutes parameter to specify when a session should be stopped if no actions are performed on it (no activity). Note that by default, sessions are stopped after 3 minutes of inactivity.
  • Session IDs: Each session is uniquely identified, e.g. 5767be3c-aef5-47f8-bcb0-4f9f80fa66a3 and is tied to an API Key.
  • The agent/start endpoint takes an optional session_id parameter. If not provided, sessions are automatically created at the start of the request and closed when the agent run is completed.

Ensure sessions are explicitly stopped to avoid unnecessary billing

We strongly recommend using the stateful API with the with statement to manage the session lifecycle and ensure it is stopped when the context manager is exited.

Additional Session Features

For more information on the additional features that are available for sessions, see the following guides: