Skip to content
中文

Create Environment

POST/agent/v1/environments◐ Partial

Request body

  • namestringrequired

    Human-readable name for the environment

  • metadataobjectoptional

    User-provided metadata key-value pairs

  • configobjectoptional

    Environment configuration

    Expand sub-fields (4)
    • typestringrequired

      Environment kind: cloud runs sessions in a sandbox recipe; self_hosted is not supported and returns 400.

      values cloudself_hosted
    • networkingobjectoptional

      Network configuration policy. Omit on update to preserve the existing value. Not used when type is self_hosted.

    • packagesobjectoptional

      Specify packages (and optionally their versions) available in this environment.

      When versioning, use the version semantics relevant for the package manager, e.g. for pip use package==1.0.0. You are responsible for validating the package and version exist. Unversioned installs the latest.

      Under limited networking, requires networking.allow_package_managers to be true. Not used when type is self_hosted.

    • templatestringoptional

      Sandbox template the environment's machines are created from: the name of a public Base from sandbox.bases.list (for example base, base-large, media) or the name or sbe_ id of one of your own ready sandbox Environments. Size is expressed by the template name, for example base-large; there is no separate size field. 1 to 128 characters of letters, digits, underscore, dot and hyphen; any other value returns 400 config.template must be a sandbox template name. The name is not checked when you save; a template the sandbox does not know fails the machine with Environment template <name> is not available. Omit on create, or send null, for the default node22; omit on update to keep it. /agent/v1 only. Not used when type is self_hosted.

  • descriptionstringoptional

    Optional description of the environment

Returns

200

Supports tenant-owned cloud environments, configuration updates and soft archival; built-ins are read-only. Lists accept limit, page and include_archived. Limited networking applies at sandbox creation; package installation failure terminates the session with ENVIRONMENT_PACKAGE_INSTALL_FAILED. self_hosted, scope and cross-session package caching are not supported.

Errors follow the Anthropic error format (type / message / request_id) — see error codes

Request

curl
curl https://api.deepraxis.com/agent/v1/environments \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"my-environment","config":{"type":"cloud"}}'
Python
import requests

opts = dict(
    base_url="https://api.deepraxis.com/agent",
    api_key="$PRAXIS_API_KEY",
)

# /agent 是我们自己的 Managed Agents 形状,直接发 HTTP 请求(Bearer 认证)
resp = requests.post(
    f"{opts['base_url']}/v1/environments",
    headers={"Authorization": f"Bearer {opts['api_key']}"},
    json={"name":"my-environment","config":{"type":"cloud"}},
)
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`, {
  method: "POST",
  headers: { Authorization: `Bearer ${opts.apiKey}`, "Content-Type": "application/json" },
  body: JSON.stringify({"name":"my-environment","config":{"type":"cloud"}}),
});
console.log(resp.status, await resp.json());

Response 200

{
  "name": "docs-k16-environment",
  "description": null,
  "metadata": {},
  "config": {
    "type": "cloud",
    "networking": {
      "type": "unrestricted"
    },
    "packages": {
      "type": "packages",
      "apt": [],
      "pip": [],
      "npm": [],
      "cargo": [],
      "gem": [],
      "go": []
    }
  },
  "type": "environment",
  "id": "env_8010a04c445b4176964e978afa1c46d0",
  "created_at": "2026-10-11T10:34:48.706Z",
  "updated_at": "2026-10-11T10:34:48.706Z",
  "archived_at": null
}

Response

HTTP 200

Successful response

application/json

Name Type Description
id string Environment identifier (e.g., 'env_...')
archived_at null | string RFC 3339 timestamp when environment was archived, or null if not archived
config object Environment configuration (either Anthropic Cloud or self-hosted)
config.networking object Network configuration policy.
config.packages object Package manager configuration.
config.type string Environment type
config.template string | null Sandbox template machines of this environment are created from: a public Base name or one of your own sandbox Environments (name or sbe_ id); size is expressed by the template name. The built-in node22 shows node22; null or absent means the default node22. /agent/v1 only.
created_at string RFC 3339 timestamp when environment was created
description null | string User-provided description for the environment; null when unset
metadata object User-provided metadata key-value pairs
name string Human-readable name for the environment
type string The type of object (always 'environment')
updated_at string RFC 3339 timestamp when environment was last updated
scope string The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.