Skip to main content
Session & Event

创建 Session

启动一个新会话

POST
/api/v1/agentstudio/sessions
cURL
curl --request POST \
  --url 'https://{workspace_id}.{region}.maas.aliyuncs.com/api/v1/agentstudio/sessions' \
  --header 'Authorization: Bearer <YOUR_API_KEY>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "agent": "agent_xxx",
  "environment_id": "env_xxx",
  "title": "Q3 销售数据分析",
  "resources": [
    {
      "type": "file",
      "file_id": "file_xxx",
      "mount_path": "/workspace/data.csv"
    }
  ]
}
'
{
  "id": "sesn_01JXH5K2M3N4",
  "type": "session",
  "status": "active",
  "agent": "agent_xxx",
  "environment_id": "env_xxx",
  "title": "Q3 销售数据分析",
  "resources": [
    {
      "type": "file",
      "file_id": "file_xxx",
      "mount_path": "/workspace/data.csv"
    }
  ],
  "vault_id": null,
  "metadata": {},
  "created_at": "2026-07-20T10:00:00Z",
  "updated_at": "2026-07-20T10:00:00Z",
  "workspace_id": "ws_xxx",
  "request_id": "req_xxx"
}

Authorizations

string
header
required

DashScope API Key

Body

application/json
string
required

智能体 ID

string
required

运行环境 ID

string

会话标题

object[]

挂载资源列表

string

密钥库 ID

object

业务自定义键值

Response

200-application/json
string

Session ID,格式 sesn_<ULID>

string

固定值 session

enum<string>

会话状态

active,idle,terminated
string

绑定的 Agent ID

string

运行环境 ID

string
object[]
string
object
string
string
string
string
RAG API
Connector API
Memory API
框架集成
  • 框架