跳转到内容
EN

列出环境

GET/anthropic/v1/environments◐ 部分支持

Claude 官方文档 ↗

请求参数

  • include_archivedboolean可选

    query: 是否包含已归档的记录。

  • limitnumber可选

    query: 每页返回的条数上限。

  • pagestring可选

    query: 分页游标,取自上一页响应的 next_page。

返回

200

支持租户自建 cloud 环境、配置更新与软归档;内置环境只读。列表支持 limit、page 和 include_archived。limited 网络在沙箱创建时生效;安装失败会终止会话,错误码为 ENVIRONMENT_PACKAGE_INSTALL_FAILED。self_hosted、scope 和跨会话包缓存尚不支持。

错误按 Claude Managed Agents 格式返回,参见 错误码

请求示例

curl
curl https://api.deepraxis.com/anthropic/v1/environments \
  -H "x-api-key: $PRAXIS_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "anthropic-beta: managed-agents-2026-04-01"
Python
from anthropic import Anthropic

client = Anthropic(
    base_url="https://api.deepraxis.com/anthropic",
    api_key="$PRAXIS_API_KEY",
)

# 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
result = client.beta.list()
print(result)
TypeScript
import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic({
  baseURL: "https://api.deepraxis.com/anthropic",
  apiKey: "$PRAXIS_API_KEY",
});

// 官方有、平台未支持:调用得到 501(not_implemented_error),无副作用。
const result = await client.beta.list();
console.log(result);

响应示例 200

{
  "data": [
    {
      "type": "environment",
      "id": "light",
      "name": "轻型",
      "description": "平台默认的轻型沙箱。",
      "config": {
        "type": "cloud",
        "networking": {
          "type": "limited",
          "allowed_hosts": [],
          "allow_mcp_servers": true,
          "allow_package_managers": false
        },
        "packages": {
          "type": "packages",
          "apt": [],
          "pip": [],
          "npm": [],
          "cargo": [],
          "gem": [],
          "go": []
        }
      },
      "metadata": {},
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "archived_at": null
    },
    {
      "type": "environment",
      "id": "node22",
      "name": "Node.js 22",
      "description": "Platform built-in Node.js 22 sandbox.",
      "config": {
        "type": "cloud",
        "networking": {
          "type": "unrestricted"
        },
        "packages": {
          "type": "packages",
          "apt": [],
          "pip": [],
          "npm": [],
          "cargo": [],
          "gem": [],
          "go": []
        }
      },
      "metadata": {},
      "created_at": "2026-01-01T00:00:00.000Z",
      "updated_at": "2026-01-01T00:00:00.000Z",
      "archived_at": null
    }
  ],
  "next_page": null
}

响应

HTTP 200

Successful response

application/json

名称 类型 说明
data array<object>
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