Session
A Session is a stateful browser environment where AI agents execute tasks. Sessions maintain browser state, cookies, and context between multiple tasks.
What is a Session?
A persistent browser instance that:
- Executes multiple tasks sequentially
- Maintains login state between tasks
- Preserves cookies and browser state
- Provides real-time viewing via live URL
Key Properties
Response Fields
id: Unique session identifierstatus:"active"or"stopped"liveUrl: Real-time browser viewing URL (null if stopped)tasks: All tasks executed in this sessionpublicShareUrl: Public share URL (if share is active)startedAt/finishedAt: Session timestamps
Creation Parameters
profileId: Profile for browser configuration (optional)proxyCountryCode: Proxy location (e.g.,"us","gb","de")startUrl: URL to navigate to when session startsbrowserScreenWidth: Custom screen width in pixels (320-6144)browserScreenHeight: Custom screen height in pixels (320-3456)
Both browserScreenWidth and browserScreenHeight must be set together or both omitted. You cannot set just one.
Session-Level Settings: Proxy location (proxyCountryCode) and browser dimensions can only be configured when creating a session. These settings cannot be changed per-task. All tasks in a session inherit the session’s proxy and browser settings.
Creating and Managing Sessions
Usage Patterns
Auto-Session (Implicit)
✅ Simple ❌ No state preservation ❌ No proxy customization (uses US by default)
Custom Session (Explicit)
✅ State preservation ✅ Multi-step workflows ✅ Custom proxy location ❌ Manual cleanup
State Management
What’s Preserved:
- Authentication cookies and tokens
- Local storage and session data
- Browser history and form data
- Downloaded resources and cache
Profile Inheritance:
Real-Time Monitoring
Live URL (Private)
The liveUrl is a private URL for viewing your session in real-time. Only accessible to authenticated users with access to the session.
Public Share
Create a public share link to allow anyone to view the session without authentication.
Public share URLs are accessible to anyone with the link. Be careful not to expose sensitive data or credentials. Delete shares when no longer needed.
Agent Session vs Browser Session
Browser Session (Standalone): Direct Chrome DevTools Protocol access for custom automation Agent Session (AI-Powered): AI agent environment for natural language task execution
These are separate products serving different use cases.
Best Practices
Use Auto-Session for: Simple tasks, no login, proof of concepts Use Custom Sessions for: Multi-step workflows, authentication, production apps
Session Management:
- Always stop sessions when done
- Use profiles to reduce setup time
- Don’t share live URLs publicly
- Clean up sessions with sensitive data