Skip to content

agentbay-ai/wuying-agentbay-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1,935 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

arXiv PyPI Downloads NPM Downloads Go Report Card Maven Central License Ask DeepWiki

AgentBay

The Cloud Sandbox Built for AI Agents

AgentBay provides on-demand cloud sandboxes for AI agents β€” isolated environments with browser, desktop, mobile, and code execution capabilities. Create a sandbox in seconds, let your agent do its work, and tear it down when done. No infrastructure to manage.

With SDKs for Python, TypeScript, Golang, and Java, AgentBay gives your agents a full cloud environment through a simple API: execute commands, browse the web, automate desktop apps, test mobile UIs, or run code β€” all in secure, disposable sandboxes.


🎯 What You Can Do

Browser Use

🌐 Browser Use

Automate web operations including content scraping, testing, and workflows. Cross-browser compatible with natural language control and remote access.

Learn more β†’

Computer Use

πŸ–₯️ Computer Use

Cloud desktop environment for enterprise application automation. Standardized interfaces enable legacy software automation with intelligent resource scheduling.

Learn more β†’

Mobile Use

πŸ“± Mobile Use

Cloud-based mobile environment for intelligent app automation. Precise UI recognition and control with parallel task processing for testing scenarios.

Learn more β†’

Code Space

πŸ’» Code Space

Professional cloud development environment supporting multi-language code generation, compilation, and debugging. Secure, intelligent automated programming experience.

Learn more β†’

βœ… Prerequisites

Before using the SDK, you need to:

  1. Register an Alibaba Cloud account: https://aliyun.com
  2. Get APIKEY credentials: AgentBay Console
  3. Set environment variable:
    • For Linux/MacOS:
      export AGENTBAY_API_KEY=your_api_key_here
    • For Windows:
      setx AGENTBAY_API_KEY your_api_key_here

πŸ“¦ Installation

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
Java See Maven snippet below Java Docs
Java Maven dependency
<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>agentbay-sdk</artifactId>
    <version>0.19.0</version>
</dependency>

πŸš€ Quick Start

Python

from agentbay import AgentBay, CreateSessionParams

agent_bay = AgentBay()

# Create a cloud sandbox (options: "code_latest", "browser_latest", "desktop_latest")
session = agent_bay.create(CreateSessionParams(image_id="code_latest")).session

# Execute code in the sandbox
result = session.code.run_code("print('Hello AgentBay')", "python")
if result.success:
    print(result.result)  # Hello AgentBay

agent_bay.delete(session)

TypeScript

import { AgentBay } from 'wuying-agentbay-sdk';

const agentBay = new AgentBay();

// Create a cloud sandbox
const session = (await agentBay.create({ imageId: "code_latest" })).session;

// Execute code in the sandbox
const result = await session.code.runCode("print('Hello AgentBay')", "python");
if (result.success) {
    console.log(result.result);  // Hello AgentBay
}

await agentBay.delete(session);

Golang

import "github.com/aliyun/wuying-agentbay-sdk/golang/pkg/agentbay"

client, _ := agentbay.NewAgentBay("", nil)

// Create a cloud sandbox
result, _ := client.Create(agentbay.NewCreateSessionParams().WithImageId("code_latest"))
session := result.Session

// Execute code in the sandbox
res, _ := session.Code.RunCode("print('Hello AgentBay')", "python")
fmt.Println(res.Output)  // Hello AgentBay

client.Delete(session, false)

Java

import com.aliyun.agentbay.*;

AgentBay agentBay = new AgentBay();

// Create a cloud sandbox
CreateSessionParams params = new CreateSessionParams().setImageId("code_latest");
Session session = agentBay.create(params).getSession();

// Execute code in the sandbox
CodeExecutionResult result = session.getCode().runCode("print('Hello AgentBay')", "python");
if (result.isSuccess()) {
    System.out.println(result.getResult());  // Hello AgentBay
}

agentBay.delete(session, false);

πŸ“š Documentation

New to AgentBay? Start with the Quick Start Tutorial β€” you'll be up and running in 5 minutes.

Resource Description
Quick Start Tutorial Get started in 5 minutes
Core Concepts Understand sessions, environments, and sandboxes
Feature Guides In-depth guides for each capability
API Reference Complete API docs (Python Β· TypeScript Β· Golang Β· Java)
Cookbook Real-world examples and recipes

πŸ”§ Core Features

πŸŽ›οΈ Session Management

  • Session Lifecycle β€” Create, manage, and delete cloud sandboxes on demand
  • Environment Configuration β€” Configure regions, endpoints, and sandbox images
  • Session Monitoring β€” Monitor status and health

πŸ› οΈ Built-in Modules

  • Command Execution β€” Run shell commands in cloud sandboxes
  • File Operations β€” Upload, download, and manage files
  • Context & Data Persistence β€” Save and retrieve data across sessions
  • Git Operations β€” Clone, commit, and manage repositories remotely

πŸ€– AI-Assisted Development

If you're using AI coding assistants (Claude, Cursor, GitHub Copilot, etc.) to develop with AgentBay SDK, use these files as context:

  • llms.txt β€” Concise overview (~14k tokens, ~55 KB)
  • llms-full.txt β€” Full SDK source, API docs, and examples (~211k tokens, ~827 KB)

πŸ†˜ Get Help

πŸ“ž Contact

Welcome to visit our product website and join our community!

πŸ“„ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Packages

 
 
 

Contributors