Skip to content

Environments

An environment is where a session runs. You choose one rather than create one. The one environment is env_default, which runs each session in the cloud, wherever the platform places it. Nothing about it can be configured over this API. Remote sandbox support is on the roadmap.

Pass env_default as environment_id when you create a session.

Endpoints

EndpointWhat it does
GET /v1/environmentsLists the environments a session can run in, which is the default cloud environment (env_default).
GET /v1/environments/{environment_id}Returns one environment, the default cloud environment (env_default).

Anthropic compatibility

Anthropic’s SDKs also have environments.create, update, delete and archive. Code written for Anthropic’s API often creates an environment before its first session. This API handles those calls as follows:

  • POST /v1/environments (environments.create) creates nothing and has no reference page. It exists so that Anthropic SDK code runs unchanged. The key must have tasks:create. With no config, or a cloud config with unrestricted networking and no packages, it returns 200 with env_default. It ignores name, description and metadata. Any other config returns 400 invalid_request_error, as does any field this API doesn’t accept, such as scope.
  • Updating, deleting or archiving an environment returns 404 not_found_error, because this API does not serve those paths.

The only environment is env_default. Remote sandbox support is on the roadmap.

Networking

Every environment reports config.networking.type as unrestricted, which is the only value the API accepts. It means the session’s sandbox can reach the public internet, unless a self-hosted (KOTS) install restricts it with a setting in the KOTS Admin Console. The networking label doesn’t reflect that setting yet. Model calls are separate and aren’t affected. See Network access for those settings, and for the planned limited mode.

A create with limited networking, packages or any other custom config returns 400:

{
"type": "error",
"error": {
"type": "invalid_request_error",
"message": "This deployment serves one environment (cloud, unrestricted networking, no extra packages); a custom environment config is not supported"
},
"request_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
}

The environment object

FieldTypeDescription
idstringAlways env_default.
typestringAlways environment.
namestringAlways default.
descriptionstringA one-line description.
configobjectAn object whose type is cloud. It also holds networking, always unrestricted, and packages, always empty.
created_atstringWhen the environment was created, as an RFC 3339 timestamp.
updated_atstringWhen the environment last changed, as an RFC 3339 timestamp.

Some fields always hold the same value: metadata is {} and archived_at is null. Treat the following values on env_default as placeholders, because they don’t describe the real environment. Its description is a fixed string. Its config always reports networking: unrestricted and empty packages. If a self-hosted install restricts sandbox network access in the KOTS Admin Console, config doesn’t show that yet.

{
"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"
}