Claude Platform Docs

Environments

Create Environment
beta.environments.create(EnvironmentCreateParams**kwargs) -> BetaEnvironment
POST/v1/environments
List Environments
beta.environments.list(EnvironmentListParams**kwargs) -> SyncPageCursor[BetaEnvironment]
GET/v1/environments
Get Environment
beta.environments.retrieve(strenvironment_id, EnvironmentRetrieveParams**kwargs) -> BetaEnvironment
GET/v1/environments/{environment_id}
Update Environment
beta.environments.update(strenvironment_id, EnvironmentUpdateParams**kwargs) -> BetaEnvironment
POST/v1/environments/{environment_id}
Delete Environment
beta.environments.delete(strenvironment_id, EnvironmentDeleteParams**kwargs) -> BetaEnvironmentDeleteResponse
DELETE/v1/environments/{environment_id}
Archive Environment
beta.environments.archive(strenvironment_id, EnvironmentArchiveParams**kwargs) -> BetaEnvironment
POST/v1/environments/{environment_id}/archive
Models
class BetaCloudConfig:

cloud environment configuration.

class BetaCloudConfigParams:

Request params for cloud environment configuration.

Fields default to null; on update, omitted fields preserve the existing value.

class BetaEnvironment:

Unified Environment resource for both cloud and self-hosted environments.

class BetaEnvironmentDeleteResponse:

Response after deleting an environment.

id: str

Environment identifier

type: Literal["environment_deleted"]

The type of response

defaultenvironment_deleted
class BetaLimitedNetwork:

Limited network access.

allow_mcp_servers: bool

Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the allowed_hosts array.

allow_package_managers: bool

Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the allowed_hosts array.

allowed_hosts: List[str]

Specifies domains the container can reach.

type: Literal["limited"]

Network policy type

class BetaLimitedNetworkParams:

Limited network request params.

Fields default to null; on update, omitted fields preserve the existing value.

type: Literal["limited"]

Network policy type

allow_mcp_servers: Optional[bool]

Permits outbound access to MCP server endpoints configured on the agent, beyond those listed in the allowed_hosts array. Defaults to false.

allow_package_managers: Optional[bool]

Permits outbound access to public package registries (PyPI, npm, etc.) beyond those listed in the allowed_hosts array. Defaults to false on creation. Must be true when packages are specified.

allowed_hosts: Optional[List[str]]

Specifies domains the container can reach.

class BetaPackages:

Packages (and their versions) available in this environment.

apt: List[str]

Ubuntu/Debian packages to install

cargo: List[str]

Rust packages to install

gem: List[str]

Ruby packages to install

go: List[str]

Go packages to install

npm: List[str]

Node.js packages to install

pip: List[str]

Python packages to install

type: Optional[Literal["packages"]]

Package configuration type

defaultpackages
class BetaPackagesParams:

Specify packages (and optionally their versions) available in this environment.

When versioning, use the version semantics relevant for the package manager, e.g. for pip use package==1.0.0. You are responsible for validating the package and version exist. Unversioned installs the latest.

Under limited networking, requires networking.allow_package_managers to be true.

class BetaSelfHostedConfig:

Configuration for self-hosted environments.

type: Literal["self_hosted"]

Environment type

class BetaSelfHostedConfigParams:

Request params for self_hosted environment configuration.

type: Literal["self_hosted"]

Environment type

class BetaUnrestrictedNetwork:

Unrestricted network access.

type: Literal["unrestricted"]

Network policy type

EnvironmentsWork

Get Work Item
beta.environments.work.retrieve(strwork_id, WorkRetrieveParams**kwargs) -> BetaSelfHostedWork
GET/v1/environments/{environment_id}/work/{work_id}
Poll for Work
beta.environments.work.poll(strenvironment_id, WorkPollParams**kwargs) -> BetaSelfHostedWork
GET/v1/environments/{environment_id}/work/poll
Acknowledge Work
beta.environments.work.ack(strwork_id, WorkAckParams**kwargs) -> BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/ack
Record Heartbeat
beta.environments.work.heartbeat(strwork_id, WorkHeartbeatParams**kwargs) -> BetaSelfHostedWorkHeartbeatResponse
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat
Stop Work
beta.environments.work.stop(strwork_id, WorkStopParams**kwargs) -> BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/stop
List Work Items
beta.environments.work.list(strenvironment_id, WorkListParams**kwargs) -> SyncPageCursor[BetaSelfHostedWork]
GET/v1/environments/{environment_id}/work
Update Work Item
beta.environments.work.update(strwork_id, WorkUpdateParams**kwargs) -> BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}
Get Queue Statistics
beta.environments.work.stats(strenvironment_id, WorkStatsParams**kwargs) -> BetaSelfHostedWorkQueueStats
GET/v1/environments/{environment_id}/work/stats