List environments
GET /v1/environments
Lists the environments a session can run in, which is the default cloud environment (env_default).
A session can run only in an environment from this list. The API has no call to create environments.
The key must have the tasks:read capability. For what each capability allows, see Keys.
Query parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
limit | integer | No | 20 | The maximum number of environments to return per page. Must be between 1 and 100. |
page | string | No | The next_page value from the previous response. Leave it out to get the first page. | |
include_archived | boolean | No | false | Has no effect, because environments are never archived. |
Response
Returns 200 with the environments in data. Pass next_page as page to get the next page. next_page is null on the last page.
{ "data": [ { "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" } ], "next_page": null}Errors
This endpoint can return these errors as well as the common errors.
| Status | error.type | Cause and fix |
|---|---|---|
| 400 | invalid_request_error | limit is outside 1 to 100. Send a value from 1 to 100. |
| 400 | invalid_request_error | page is not a next_page value from this API. Send the next_page value from the previous response, unchanged. |
Example
curl -sS "$CONTEXT_BASE_URL/v1/environments" -H "x-api-key: $CONTEXT_API_KEY"for env in client.beta.environments.list(): print(env.id, env.name)for await (const env of client.beta.environments.list()) console.log(env.id, env.name)