Skip to main content

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
Trusted by leading companies across agentic commerce, GTM research, sales, marketing, and productivity automation.

Base URL

All API requests should be made to:
https://api.agi.tech/v1

Authentication

Secure by default. All API endpoints require authentication using a Bearer token. Include your API key in the Authorization header of every request:
const headers = {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
};
Security Note: If authentication fails, endpoints will return 401 (Unauthorized) or 403 (Forbidden) status codes. Keep your API keys secure and never commit them to version control.

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:
Agent’s reasoning process or actions being taken
Questions requiring user input or clarification
Task completion with final results
Error notifications and failure states
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:
const messages = await session.getMessages({ afterId: 0 });
Track the highest message id you’ve seen and use it as after_id in subsequent requests to get only new messages.

Server-Sent Events (SSE)

Real-time updates. Connect to the /events endpoint for live streaming:
for await (const event of session.streamEvents()) {
    console.log(event);
}

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

Support

We’re here to help. For issues, questions, or feature requests: Ready to dive deeper? Explore the detailed endpoint documentation below.