Skip to content

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

NameTypeRequiredDefaultDescription
environment_idstringYesThe 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.

Statuserror.typeCause and fix
404not_found_errorThe ID is not env_default. Use env_default.

Example

cURL
curl -sS "$CONTEXT_BASE_URL/v1/environments/env_default" -H "x-api-key: $CONTEXT_API_KEY"
Python
env = client.beta.environments.retrieve("env_default")
TypeScript
const env = await client.beta.environments.retrieve("env_default")