Current collected state Current
Observed since 20 Oct, 21:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Minimal cloud browser SDK for AgentBay (Alibaba Cloud Wuying) — session lifecycle management via CDP.
Minimal cloud browser SDK for AgentBay (Alibaba Cloud Wuying) — session lifecycle management via CDP.
httpx + pydantic, no Alibaba Cloud SDK dependencyAgentBayCloud and AsyncAgentBayCloud clientspip install agentbay-lite
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()
with AgentBayCloud(api_key="...") as client:
with client.sessions.create() as session:
... # session auto-deleted on exit
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())
| Feature | Usage |
|---|---|
| Stealth mode | create(browser_mode="stealth") |
| Custom proxy | create(proxy=ProxyConfig(server="http://...")) |
| Managed proxy | create(proxy=ManagedProxyConfig(country="US")) |
| Fingerprint | create(fingerprint=FingerprintConfig(user_agent="...")) |
| Context persistence | create(context=ContextAttach(context_id="...")) |
| Recording control | create(recording=RecordingConfig(enabled=False)) |
| Custom image | create(image_id="img-xxx") |
| Session labels | create(labels={"env": "prod"}) |
| Idle timeout | create(idle_release_timeout=300) |
# 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)
| Environment Variable | Description | Default |
|---|---|---|
AGENTBAY_API_KEY | API key (required if not passed explicitly) | — |
AGENTBAY_ENDPOINT | API endpoint hostname | wuyingai.cn-shanghai.aliyuncs.com |
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
MIT
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.1 | 17 Mar 2026 | 6 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 21:32 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e6e716bd9e448bf96b8cef6f907f298e4c0b59ed785207def6d5e875f2449bca