列出环境
GET
/agent/v1/environments◐ 部分支持请求参数
include_archivedboolean可选query: Include archived environments in the response
limitnumber可选query: Number of items per page.
pagestring可选query: 不透明分页游标:原样传入上一响应的 next_page 值。第一页省略。来自不同查询或格式错误的游标返回 400。
返回
200
支持租户自建 cloud 环境、配置更新与软归档;内置环境只读。列表支持 limit、page 和 include_archived。limited 网络在沙箱创建时生效;安装失败会终止会话,错误码为 ENVIRONMENT_PACKAGE_INSTALL_FAILED。self_hosted、scope 和跨会话包缓存尚不支持。
错误按 Anthropic 错误格式返回(type / message / request_id),参见 错误码
请求示例
curl
curl https://api.deepraxis.com/agent/v1/environments \
-H "Authorization: Bearer $PRAXIS_API_KEY"Python
import requests
opts = dict(
base_url="https://api.deepraxis.com/agent",
api_key="$PRAXIS_API_KEY",
)
# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.get(
f"{opts['base_url']}/v1/environments",
headers={"Authorization": f"Bearer {opts['api_key']}"},
)
print(resp.status_code, resp.json())TypeScript
const opts = {
baseURL: "https://api.deepraxis.com/agent",
apiKey: "$PRAXIS_API_KEY",
};
// /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
const resp = await fetch(`${opts.baseURL}/v1/environments`, {
headers: { Authorization: `Bearer ${opts.apiKey}` },
});
console.log(resp.status, await resp.json());响应示例 200
{
"data": [
{
"id": "env_deepraxis_text_v1",
"name": "Deepractice Text v1",
"description": "Platform built-in text environment.",
"type": "environment",
"archived_at": null,
"config": {
"type": "cloud",
"networking": {
"type": "limited",
"allowed_hosts": [],
"allow_package_managers": false,
"allow_mcp_servers": false
},
"packages": {
"type": "packages",
"apt": [],
"cargo": [],
"gem": [],
"go": [],
"npm": [],
"pip": []
}
},
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z",
"metadata": {}
},
{
"id": "node22",
"name": "Node.js 22",
"description": "Platform built-in Node.js 22 sandbox.",
"type": "environment",
"archived_at": null,
"config": {
"type": "cloud",
"networking": {
"type": "limited",
"allowed_hosts": [],
"allow_package_managers": false,
"allow_mcp_servers": false
},
"packages": {
"type": "packages",
"apt": [],
"cargo": [],
"gem": [],
"go": [],
"npm": [],
"pip": []
}
},
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z",
"metadata": {}
}
],
"next_page": null
}响应
HTTP 200
Successful response
application/json
| 名称 | 类型 | 说明 |
|---|---|---|
| data | array<object> | Items of this page, in the order requested by the call. |
| data[].id | string | Environment identifier (e.g., 'env_...') |
| data[].archived_at | null | string | RFC 3339 timestamp when environment was archived, or null if not archived |
| data[].config | object | Environment configuration (either Anthropic Cloud or self-hosted) |
| data[].created_at | string | RFC 3339 timestamp when environment was created |
| data[].description | null | string | User-provided description for the environment; null when unset |
| data[].metadata | object | User-provided metadata key-value pairs |
| data[].name | string | Human-readable name for the environment |
| data[].type | string | The type of object (always 'environment') |
| data[].updated_at | string | RFC 3339 timestamp when environment was last updated |
| data[].scope | string | The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account. |
| next_page | string | null | Opaque cursor for the next page: pass it unchanged as page to continue. Null when this is the last page. |