Get an environment
GET /v1/environments/{environment_id}
Returns one environment, the default cloud environment (env_default).
To run a session in this environment, pass its id as environment_id when you create the session.
The key must have the tasks:read capability. For what each capability allows, see Keys.
Path parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
environment_id | string | Yes | The ID of the environment to retrieve: env_default. |
Response
Returns 200 with the environment object. For every field, see Environments.
{ "id": "env_default", "archived_at": null, "config": { "type": "cloud", "networking": { "type": "unrestricted" }, "packages": { "apt": [], "cargo": [], "gem": [], "go": [], "npm": [], "pip": [] } }, "created_at": "2026-10-14T00:00:00.000Z", "description": "The platform's own runtime. Every session runs here.", "metadata": {}, "name": "default", "type": "environment", "updated_at": "2026-10-14T00:00:00.000Z"}Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 404 | not_found_error | The ID is not env_default. Use env_default. |
Example
curl -sS "$CONTEXT_BASE_URL/v1/environments/env_default" -H "x-api-key: $CONTEXT_API_KEY"env = client.beta.environments.retrieve("env_default")const env = await client.beta.environments.retrieve("env_default")