Browser sessions last 5 minutes and consume 1 credit ($0.01).
What are Sessions?
Sessions allow you to interact with browser profiles to setup persistent cookies and authentication across runs. Once a profile is created, it can be utilized for running agent tasks that require user authentication.- Create a Profile Open a new session. The system will return a profile_id (a unique identifier for your profile), and, if requested, a live_url (to interact with the remote browser window) and a live_id (used to close the browser session and save changes).
- Authenticate via the Live URL Use the provided live_url to log in to any target platform (e.g., your project management tool, social media account) as you normally would. This action securely stores your authentication cookies within the profile.
- Execute Tasks with the Profile ID When running an agent task, simply include the profile_id. The agent will use the stored authentication from that profile, allowing it to immediately access the platform as a logged-in user.
Open a browser session
Open a browser session and create a profile in 4 lines of code.If Python is not your language of choice, check out our API Reference.
Parameters
All parameters available when opening a browser session.The unique identifier for the browser profile. If omitted, a random profile ID will be generated and returned.This id will be used when running a task.Example:
my-test-profileRequest a live URL to interact with the browser session. Default:
True.Set it to True if you want to manually interact with the browser to perform logins or other authentications.
Set it to False if you want to simply create an empty browser profile for Smooth to interact with in future tasks.The device type used for the session. One of: [“mobile”, “desktop”].Note that
mobile does not support navigation via the search bar, so a starting URL must be provided.The starting URL for the session.
The hostname or IP address of the proxy server that will be used for the session.Example:
proxy.example.comThe username for authenticating with the proxy server, if authentication is required.Example:
user123The password for authenticating with the proxy server, if authentication is required.Example:
password123Response
Returns aBrowserSessionHandle with the following attributes.
Returns ID of the session.
Returns a live URL where you can interact with the browser (requires
live_view=True).Set interactive=True to get an interactive view.Set embed=True to get an embeddable view (ideal for iframes).Returns the live ID for the browser session. It can be passed to
.close_session to close the session and save the browser profile.Close a browser session
To close a live browser session, simply call.close_session.
If the browser session is not manually closed, the profile is saved automatically when the 5 minutes time limit is reached.