Skip to main content
Environment

Create Environment

Create a runtime environment

POST
/api/v1/agentstudio/environments
cURL
curl --request POST \
  --url 'https://{workspace_id}.{region}.maas.aliyuncs.com/api/v1/agentstudio/environments' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "data-sandbox",
  "description": "数据分析沙箱",
  "scope": "organization",
  "metadata": {
    "team": "infra"
  },
  "config": {
    "type": "cloud",
    "packages": {
      "apt": [
        "ffmpeg"
      ],
      "pip": [
        "pandas",
        "numpy",
        "matplotlib"
      ]
    },
    "networking": {
      "type": "unrestricted"
    }
  }
}
'
{
  "id": "env_xxx",
  "type": "environment",
  "name": "data-sandbox",
  "description": "数据分析沙箱",
  "scope": "organization",
  "config": {
    "type": "cloud",
    "packages": {
      "apt": [
        "ffmpeg"
      ],
      "pip": [
        "pandas",
        "numpy",
        "matplotlib"
      ]
    },
    "networking": {
      "type": "unrestricted"
    }
  },
  "metadata": {
    "team": "infra"
  },
  "archived_at": null,
  "created_at": "2026-06-16T12:45:34+08:00",
  "updated_at": "2026-06-16T12:45:34+08:00",
  "requestId": "xxx"
}

Authorizations

string
header
required

DashScope API Key

Body

application/json
string
required

工作空间内唯一标识

string

环境用途说明

enum<string>

作用域。organization:工作空间全部成员可见与复用。默认 organization

organization
object

沙箱配置

object

业务自定义键值,不影响运行行为

Response

200-application/json
string

环境 ID,格式 env_<base64 编码字符串>,示例值 env_N2M2OTc4NTY4ZjRkNDEwZT

string

固定为 environment

string

工作空间内唯一标识

string

环境用途说明

string

作用域。organization 表示工作空间全部成员可见与复用

object

完整运行时配置(沙箱类型、预装依赖、网络策略)

object

业务自定义键值

string | null

归档时间,未归档时为 null

string

创建时间,ISO 8601

string

最近更新时间,ISO 8601

string

本次请求的唯一标识

Overview
Sandbox API
Memory API
Flow Agent API
RAG API
Connector API
Framework Integration
Assistant API (Deprecating)
  • Overview