Overview
Production-ready autonomous agents that take action for you. The AGI Agent Sessions API enables you to create browser agent sessions that can:Internet Research
Gather information, compare options, and compile reports
Form Automation
Fill out forms, complete registrations, and handle workflows
E-commerce
Make purchases, track prices, and monitor inventory
Web Automation
Navigate complex sites and complete multi-step tasks
Base URL
All API requests should be made to:Authentication
Secure by default. All API endpoints require authentication using a Bearer token. Include your API key in theAuthorization header of every request:
- JavaScript
- Python
- HTTPie
Getting Started
Five simple steps to deploy your first agent:1
Create a session
Start by creating a new agent session with your preferred model
2
Send a message
Give the agent a task using natural language instructions
3
Monitor progress
Poll for status updates or stream events in real-time via SSE
4
Control execution
Pause, resume, or cancel tasks as needed
5
Clean up
Delete the session when you’re done
Quickstart Guide
Get your first agent running in under 5 minutes
Key Concepts
Sessions
A session represents a single browser environment with an agent. Each session has its own isolated browser state and can execute one task at a time.Session Isolation
Each session runs in a completely isolated environment for security and reliability
Agent Models
Choose the right agent model for your use case:agi-0
Default model with full capabilities and maximum intelligence
agi-0-fast
Optimized for speed with faster response times
Message Types
The agent communicates through structured messages:THOUGHT
THOUGHT
Agent’s reasoning process or actions being taken
QUESTION
QUESTION
Questions requiring user input or clarification
DONE
DONE
Task completion with final results
ERROR
ERROR
Error notifications and failure states
LOG
LOG
Additional context or debugging information
Session Status vs Execution Status
Two complementary status systems help you track agent state:- Session Status: Lifecycle state (
initializing,ready,running,paused,completed,error,terminated) - Execution Status: Current task state (
running,waiting_for_input,finished,error)
Interaction Patterns
Two ways to monitor your agents — choose what works best for your architecture:Polling
Simple and reliable. Use the/messages endpoint with the after_id parameter to poll for new messages:
- JavaScript
- Python
- HTTPie
Server-Sent Events (SSE)
Real-time updates. Connect to the/events endpoint for live streaming:
- JavaScript
- Python
- HTTPie
SSE Benefits
Lower latency, reduced polling overhead, and true real-time monitoring
Security & Risk Prevention
Enterprise-grade security built into every request:Rate Limiting
Automatic throttling prevents abuse and ensures fair usage
Malicious Intent Screening
Real-time screening before command execution
Secure Payments
Support for 1-time-use payment tokens
Session Isolation
Complete isolation between sessions