Catalog PyPI
PACKAGE EXPLORERView in registry

agentbay-lite

PyPI

Minimal cloud browser SDK for AgentBay (Alibaba Cloud Wuying) — session lifecycle management via CDP.

agentbaybrowser-automationcdpcloud-browserwuying
Versions collected1
Direct dependencies6From release 1.0.1
Last observed20 Oct, 21:32 UTC

README

Version 1.0.1 documentation

agentbay-lite

PyPI version Python License: MIT

Minimal cloud browser SDK for AgentBay (Alibaba Cloud Wuying) — session lifecycle management via CDP.

  • Lightweight: only httpx + pydantic, no Alibaba Cloud SDK dependency
  • Sync & Async: AgentBayCloud and AsyncAgentBayCloud clients
  • Context manager: sessions auto-delete on exit
  • Alibaba Cloud RPC: proper Bearer token auth with Timestamp/SignatureNonce
  • Unified interface: same API shape as browser-use-lite, skyvern-lite, airtop-lite

Install

pip install agentbay-lite

Quick Start

from agentbay_lite import AgentBayCloud

client = AgentBayCloud(api_key="...")  # or set AGENTBAY_API_KEY env var

# Create a cloud browser session (3-step RPC: CreateMcpSession -> InitBrowser -> GetCdpLink)
session = client.sessions.create()
print(session.cdp_url)   # wss://...
print(session.session_id)

# Use with Playwright (or any CDP client)
from playwright.sync_api import sync_playwright
with sync_playwright() as pw:
    browser = pw.chromium.connect_over_cdp(session.cdp_url)
    page = browser.contexts[0].new_page()
    page.goto("https://example.com")

# Cleanup
client.sessions.delete(session.session_id)
client.close()

Context Manager

with AgentBayCloud(api_key="...") as client:
    with client.sessions.create() as session:
        ...  # session auto-deleted on exit

Async

import asyncio
from agentbay_lite import AsyncAgentBayCloud

async def main():
    async with AsyncAgentBayCloud(api_key="...") as client:
        session = await client.sessions.create()
        print(session.cdp_url)
        await client.sessions.delete(session.session_id)

asyncio.run(main())

Features

FeatureUsage
Stealth modecreate(browser_mode="stealth")
Custom proxycreate(proxy=ProxyConfig(server="http://..."))
Managed proxycreate(proxy=ManagedProxyConfig(country="US"))
Fingerprintcreate(fingerprint=FingerprintConfig(user_agent="..."))
Context persistencecreate(context=ContextAttach(context_id="..."))
Recording controlcreate(recording=RecordingConfig(enabled=False))
Custom imagecreate(image_id="img-xxx")
Session labelscreate(labels={"env": "prod"})
Idle timeoutcreate(idle_release_timeout=300)

Session CRUD

# Create
session = client.sessions.create()

# Get
info = client.sessions.get(session.session_id)

# List
sessions = client.sessions.list(status="RUNNING")

# Delete (idempotent)
client.sessions.delete(session.session_id)

Configuration

Environment VariableDescriptionDefault
AGENTBAY_API_KEYAPI key (required if not passed explicitly)—
AGENTBAY_ENDPOINTAPI endpoint hostnamewuyingai.cn-shanghai.aliyuncs.com

Exception Hierarchy

CloudBrowserError          # Base exception
├── AuthenticationError    # 401/403 — invalid or expired API key
├── QuotaExceededError     # 429 — rate limit (has .retry_after attribute)
├── SessionNotFoundError   # 404 — session doesn't exist
├── ProviderError          # 5xx — server error (has .status_code, .request_id)
├── TimeoutError           # Operation timed out
└── NetworkError           # Connection failure

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.117 Mar 20266

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
ayanami-browser-pilot/agentbay-lite

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 21:32 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:e6e716bd9e448bf96b8cef6f907f298e4c0b59ed785207def6d5e875f2449bca