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 body
| Field | Required | Type | Description |
|---|---|---|---|
name | Yes | string | Unique identifier within the workspace |
description | No | string | Description of the environment's purpose |
scope | No | string | Scope of the environment. organization: visible to and reusable by all members of the workspace. Defaults to organization |
config.type | No | string | Sandbox type. cloud = cloud container. Immutable after creation. Defaults to cloud when config is omitted |
config.packages | No | 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 sessions |
config.networking | No | object | Network policy object, shaped as {"type": "unrestricted"}. Currently only unrestricted outbound access is supported |
metadata | No | object | Custom business key-value pairs; do not affect runtime behavior |
Request example
Response example
Response fields
| Field | Type | Description |
|---|---|---|
id | string | Environment ID, format env_ + base64-encoded string, for example env_N2M2OTc4NTY4ZjRkNDEwZT |
type | string | Fixed value environment |
name / description / scope / config / metadata | string / object | Same as the request body; config contains the full runtime configuration (sandbox type, preinstalled dependencies, network policy) |
archived_at | string | null | Archive time; null when not archived |
created_at / updated_at | string | Creation / last update time, ISO 8601 |
requestId | string | Unique identifier for this request |