The Cloud Sandbox Built for AI Agents
Browser Β·
Desktop Β·
Mobile Β·
Code
| Language | Install Command | Documentation |
|---|---|---|
| Python | pip install wuying-agentbay-sdk |
Python Docs |
| TypeScript | npm install wuying-agentbay-sdk |
TypeScript Docs |
| Golang | go get github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay |
Golang Docs |
Before using the SDK, you need to:
- Register an Alibaba Cloud account: https://aliyun.com
- Get APIKEY credentials: AgentBay Console
- Set environment variable:
- For Linux/MacOS:
export AGENTBAY_API_KEY=your_api_key_here - For Windows:
setx AGENTBAY_API_KEY your_api_key_here
- For Linux/MacOS:
from agentbay import AgentBay, CreateSessionParams
# Create session and execute code
agent_bay = AgentBay()
session = agent_bay.create(CreateSessionParams(image_id="code_latest")).session
result = session.code.run_code("print('Hello AgentBay')", "python")
if result.success:
print(result.result) # Hello AgentBay
# Clean up
agent_bay.delete(session)import asyncio
from agentbay import AsyncAgentBay, CreateSessionParams
async def main():
# Create session and execute code
agent_bay = AsyncAgentBay()
session = (await agent_bay.create(CreateSessionParams(image_id="code_latest"))).session
result = await session.code.run_code("print('Hello AgentBay')", "python")
if result.success:
print(result.result) # Hello AgentBay
# Clean up
await agent_bay.delete(session)
if __name__ == "__main__":
asyncio.run(main())import { AgentBay } from 'wuying-agentbay-sdk';
// Create session and execute code
const agentBay = new AgentBay();
const session = (await agentBay.create({ imageId: "code_latest" })).session;
const result = await session.code.runCode("print('Hello AgentBay')", "python");
if (result.success) {
console.log(result.result); // Hello AgentBay
}
// Clean up
await agentBay.delete(session);import "github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay"
// Create session and execute code
client, _ := agentbay.NewAgentBay("", nil)
result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("code_latest"))
session := result.Session
res, _ := session.Code.RunCode("print('Hello AgentBay')", "python")
fmt.Println(res.Output) // Hello AgentBay
// Clean up
client.Delete(session, false)AgentBay Python SDK provides both synchronous and asynchronous APIs to suit different application needs.
| Feature | Sync API (AgentBay) |
Async API (AsyncAgentBay) |
|---|---|---|
| Import | from agentbay import AgentBay |
from agentbay import AsyncAgentBay |
| Best for | Scripts, simple tools, CLI apps | Web servers (FastAPI/Django), high-concurrency apps |
| Blocking | Yes, blocks thread until complete | No, allows other tasks to run |
| Usage | client.create(...) |
await client.create(...) |
Complete Documentation - Full guides, tutorials, and API references
π New Users - If you're new to AgentBay or cloud development:
- Quick Start Tutorial - Get started in 5 minutes
- Core Concepts - Understand cloud environments and sessions
π Experienced Users - Already familiar with browser automation, computer use, mobile testing, or cloud development environments:
- Choose your environment:
- π Browser Automation - Web scraping, testing, form filling with stealth capabilities
- π₯οΈ Computer/Windows Automation - Desktop UI automation and window management
- π± Mobile Automation - Android UI testing and gesture automation
- π» CodeSpace - Cloud-based code execution environments
- Feature Guides - Complete feature introduction
- API Reference - Comprehensive API documentation with examples
- Python API Reference - Auto-generated from source code
- TypeScript API Reference - Auto-generated from source code
- Golang API Reference - Auto-generated from source code
- π All API docs include complete runnable examples and actual output
- Cookbook - Real-world examples and recipes
- Session Creation & Lifecycle - Create, manage, and delete cloud environments
- Environment Configuration - Configure SDK settings, regions, and endpoints
- Session Monitoring - Monitor session status and health validation
- Command Execution - Execute Shell commands in cloud environments
- File Operations - Upload, download, and manage cloud files
- Data Persistence - Save and retrieve data across sessions
- Context Management - Synchronize data and maintain state
- Computer Use - General automation and desktop operations
- Browser Use - Web automation, scraping, and browser control
- CodeSpace - Code execution and development environment
- Mobile Use - Mobile device simulation and control
If you're using AI coding assistants (Claude, Cursor, GitHub Copilot, etc.) to develop with AgentBay SDK, you can use llms.txt and llms-full.txt as context for better code suggestions:
- llms.txt - Concise documentation index (~900 tokens) for quick reference
- llms-full.txt - Complete documentation corpus (~140k tokens) for comprehensive context
These files contain the full SDK documentation across all languages (Python, TypeScript, Golang), API references, and cookbook examples. Simply reference them in your AI assistant to get better understanding of the SDK's architecture and APIs.
Welcome to visit our product website and join our community!
- π AgentBay International Website: https://www.alibabacloud.com/product/agentbay
- π¨π³ AgentBay China Website (Chinese): https://www.aliyun.com/product/agentbay
- π¬ Discord Community: Join on Discord
- πΌ DingTalk Group: Click to join
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.



