Skip to main content

Overview

The Tessa Python SDK provides a powerful and intuitive interface for automating web browsing tasks using AI-powered agents. With 93% accuracy on WebVoyager, our SDK delivers industry-leading performance for browser automation.
The SDK requires Python 3.8 or higher and is available on PyPI as tessa_sdk.

Key Features

One-Line Automation

Simple, intuitive API that lets you automate browsers with a single line of code

Sync & Async Support

Both synchronous and asynchronous clients for any use case

Type Safety

Full type hints and Pydantic models for better IDE support

Real-Time Monitoring

Watch your browser agents work in real-time through live URLs

Quick Example

Here’s how simple it is to use the Tessa SDK:
from tessa_sdk import BrowserAgent

# One-line browser automation
result = BrowserAgent("YOUR_API_KEY").run(
    "Go to news.ycombinator.com and get the top 5 stories"
)
print(result.output)

Three Ways to Use

The SDK offers three different interfaces to match your needs:

1. BrowserAgent (Simplest)

The BrowserAgent class provides the simplest interface for common automation tasks:
from tessa_sdk import BrowserAgent

agent = BrowserAgent("YOUR_API_KEY")
result = agent.run("Extract data from example.com")
Perfect for:
  • Quick automation scripts
  • Simple data extraction
  • One-off tasks
  • Prototyping

2. TessaClient (Full Control)

The TessaClient provides complete control over job management:
from tessa_sdk import TessaClient

with TessaClient("YOUR_API_KEY") as client:
    job = client.run_browser_agent("Complex multi-step task")
    # Monitor progress
    print(f"Watch live: {job.live_url}")
    # Wait for completion
    result = job.wait_for_completion()
Perfect for:
  • Production applications
  • Complex workflows
  • Job monitoring and management
  • Custom error handling

3. AsyncTessaClient (Concurrent Operations)

The AsyncTessaClient enables high-performance concurrent operations:
import asyncio
from tessa_sdk import AsyncTessaClient

async def run_multiple():
    async with AsyncTessaClient("YOUR_API_KEY") as client:
        jobs = await asyncio.gather(
            client.run_browser_agent("Task 1"),
            client.run_browser_agent("Task 2"),
            client.run_browser_agent("Task 3")
        )
        results = await asyncio.gather(
            *[job.wait_for_completion() for job in jobs]
        )
Perfect for:
  • High-volume processing
  • Concurrent automation
  • Async web frameworks
  • Performance-critical applications

Use Cases

The Tessa SDK excels at:
Extract structured data from any website, even those with complex JavaScript rendering or anti-bot measures.
result = agent.extract(
    url="https://example.com/products",
    data_description="product names, prices, and availability"
)
Fill and submit forms automatically, handling complex interactions and validations.
result = agent.fill_form(
    url="https://example.com/contact",
    form_data={"name": "John", "email": "john@example.com"}
)
Monitor prices, inventory, and product listings across multiple e-commerce platforms.
result = agent.run("""
    Search amazon.com for 'iPhone 15 Pro'.
    Extract prices and availability for top 5 results.
""")
Extract engagement metrics, trending topics, and content from social platforms.
result = agent.run("""
    Go to twitter.com/elonmusk and extract
    the last 5 tweets with likes and retweets.
""")

Architecture

The SDK is built with modern Python best practices:
  • Type Safety: Full type hints using Python’s typing module
  • Data Validation: Pydantic models for request/response validation
  • Error Handling: Comprehensive exception hierarchy
  • Thread Safety: Sync client works safely in any environment
  • Resource Management: Context managers for automatic cleanup
  • Flexible Configuration: Environment variables and explicit parameters

AI Models

Choose from multiple AI models for action selection:
ModelDescriptionBest For
claude-sonnet-4-20250514Default model with best overall performanceGeneral automation
gpt-4oOpenAI’s GPT-4 modelComplex reasoning tasks
gemini/gemini-2.5-flashGoogle’s Gemini Flash modelFast, cost-effective tasks

Browser Configuration

Customize browser behavior with flexible configuration options:
from tessa_sdk import BrowserConfig

config = BrowserConfig(
    width=1920,                # Viewport width (320-4096)
    height=1080,               # Viewport height (320-4096)
    residential_ip=True,       # Use residential IP proxy
    max_duration_minutes=30,   # Maximum session duration (1-240)
    idle_timeout_minutes=2     # Idle timeout (1-60)
)

Credits and Pricing

  • 1 credit per browser action
  • 1,000 free credits for new accounts
  • Monitor usage in your code:
result = agent.run("Your task")
print(f"Credits used: {result.credits_used}")
print(f"Remaining balance: {result.credit_balance}")

Next Steps

Support

Need help? We’re here to assist:
I