Skip to main content
Overview

Quick Start

Create an agent, configure its environment, initiate a session, and make calls—all in four steps via the console.

Prerequisites

  • You have activated Alibaba Cloud Bailian.
  • Your current account has Managed Agents operation permissions in the target workspace.

Step 1: Configure the Agent

Navigate to Bailian Console > Managed Agents > Quick Start, and fill in the agent’s basic information, model, and tools. The page is pre-filled with template values—you may modify them as needed.
FieldDescription
NameDefault: Agent_v1; customizable
ModelRequired. Select from the dropdown list (e.g., qwen3.7-plus)
System PromptDefines the agent’s role and behavior. A generic template is pre-filled; customize it per your use case
ToolsSeven built-in tools are selected by default: bash, read, write, edit, glob, grep, download_file. Deselect as needed
Skill / MCPOptional. Skip during Quick Start; add later on the agent detail page
You can also complete this step programmatically using the API—specify name, model, and tools (see Create Agent API):
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/agents" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "data-analyst",
    "model": {"id": "qwen3-max"},
    "system": "你是数据分析专家,使用 pandas 处理 CSV 文件。",
    "tools": [
      {
        "type": "builtin_toolkit",
        "default_config": {"enabled": true},
        "configs": [
          {"name": "bash", "enabled": true},
          {"name": "read", "enabled": true},
          {"name": "write", "enabled": true}
        ]
      }
    ]
  }'
After completing the form, click Finish & Next. The system creates and saves the agent, then proceeds to environment configuration.

Step 2: Configure the Runtime Environment

The environment defines the execution sandbox for tool calls and is managed independently from the agent.
FieldDescription
NameDefault: Agent_v1_Env; customizable
Hosting TypeDefault: Cloud-hosted (sandbox container managed by Bailian)
You can also complete this step programmatically using the API—specify sandbox type and pre-installed packages (see Create Environment API):
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/environments" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "data-sandbox",
    "description": "数据分析沙箱",
    "config": {
      "type": "cloud",
      "packages": {
        "apt": ["ffmpeg"],
        "pip": ["pandas", "numpy", "matplotlib"]
      },
      "networking": {"type": "unrestricted"}
    }
  }'
Click Finish & Next. The system creates and saves the environment, then proceeds to session configuration.

Step 3: Confirm Session Configuration

The page displays summaries of the created agent and environment and automatically initiates a session based on both.
  • Verify the Agent card: name and model information.
  • Verify the Environment card: name and hosting type.
  • To use local files inside the sandbox, click Upload Files to mount them; otherwise, skip.
You can also complete this step programmatically using the API—bind the agent and environment (see Create Session API):
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/sessions" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent": "agent_xxx",
    "environment_id": "env_xxx",
    "title": "Q3 销售数据分析"
  }'
Click Finish & Next. The system binds the agent and environment, creates and saves the session, then proceeds to the invocation page.

Step 4: Begin Invocation

Configuration is complete. The page provides two tabs:
  • Callable API: Displays the curl command to create an event—copy and run it directly in your terminal.
  • Preview & Debug: Chat directly with the agent in-browser and view real-time events and tool invocations. Use the dropdown in the top-left corner to filter by event type (User, Agent, Tool, Tool_output, Error, Model, System).
Send a message to trigger agent processing (see Send Event API):
curl -X POST "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/sessions/sesn_xxx/events" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": [
      {
        "role": "user",
        "type": "message",
        "content": [
          {"type": "text", "text": "分析 /mnt/session/uploads/sales.csv 中 Q3 的销售趋势"}
        ]
      }
    ]
  }'
Receive processing progress and output in real time via SSE event stream (see SSE Event Stream API):
curl -N "https://{workspace_id}.cn-beijing.maas.aliyuncs.com/api/v1/agentstudio/sessions/sesn_xxx/events/stream" \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H "Accept: text/event-stream"
After debugging, click Return to Agent List to enter the management page. The agent, environment, and session created in the first three steps are all saved—you can view and edit them anytime from their respective menus.

Next Steps