Create a runtime environment. The request body defines the sandbox type, preinstalled dependencies, and network policy; the response returns the full Environment object.
Prerequisites
Endpoint and authentication are configured. See Overview and authentication.
Endpoint
POST /environments
Request bodynamestring (必选)Unique identifier within the workspacedescription string (可选)Description of the environment's purposescope string (可选)Scope of the environment. organization: visible to and reusable by all members of the workspace. Defaults to organizationconfig.type string (可选)Sandbox type. cloud = cloud container. Immutable after creation. Defaults to cloud when config is omittedconfig.packages object (可选)Preinstalled dependencies grouped by package manager. Keys are apt | pip | npm; values are arrays of package names. Installation may require warm-up time; until it completes, the environment cannot be bound to sessionsconfig.networking object (可选)Network policy object, shaped as {"type": "unrestricted"}. Currently only unrestricted outbound access is supportedmetadata object (可选)Custom business key-value pairs; do not affect runtime behavior | Request example |
Response fieldsidstringEnvironment ID, format env_ + base64-encoded string, for example env_N2M2OTc4NTY4ZjRkNDEwZTtype stringFixed value environmentname / description / scope / config / metadata string / objectSame as the request body; config contains the full runtime configuration (sandbox type, preinstalled dependencies, network policy)archived_at string | nullArchive time; null when not archivedcreated_at / updated_at stringCreation / last update time, ISO 8601requestId stringUnique identifier for this request | Response example |