Claude Platform Docs

Ambienti

Crea ambiente
beta.environments.create(**kwargs) -> BetaEnvironment
POST/v1/environments

Crea un nuovo ambiente con la configurazione specificata.

Elenca gli ambienti
beta.environments.list(**kwargs) -> SyncPageCursor[BetaEnvironment]
GET/v1/environments

Elenca gli ambienti con supporto per la paginazione.

Ottieni ambiente
beta.environments.retrieve(environment_id, **kwargs) -> BetaEnvironment
GET/v1/environments/{environment_id}

Recupera un ambiente specifico tramite ID.

Aggiorna ambiente
beta.environments.update(environment_id, **kwargs) -> BetaEnvironment
POST/v1/environments/{environment_id}

Aggiorna la configurazione di un ambiente esistente.

Elimina ambiente
beta.environments.delete(environment_id, **kwargs) -> BetaEnvironmentDeleteResponse
DELETE/v1/environments/{environment_id}

Elimina un ambiente tramite ID. Restituisce una conferma dell'eliminazione.

Archivia ambiente
beta.environments.archive(environment_id, **kwargs) -> BetaEnvironment
POST/v1/environments/{environment_id}/archive

Archivia un ambiente tramite ID. Gli ambienti archiviati non possono essere utilizzati per creare nuove sessioni.

Models
class BetaCloudConfig: type: "cloud"; networking; packages

cloud environment configuration.

class BetaCloudConfigParams: type: "cloud"; networking; packages

Request params for cloud environment configuration.

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

class BetaEnvironment: type: "environment"; id; archived_at; ... # 7 more

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

class BetaEnvironmentDeleteResponse: type: "environment_deleted"; id

Response after deleting an environment.

type: Literal["environment_deleted"]

The type of response

defaultenvironment_deleted
id: str

Environment identifier

class BetaLimitedNetwork: type: "limited"; allow_mcp_servers; allow_package_managers; allowed_hosts

Limited network access.

type: Literal["limited"]

Network policy type

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.

class BetaLimitedNetworkParams: type: "limited"; allow_mcp_servers; allow_package_managers; allowed_hosts

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: type; apt; cargo; ... # 4 more

Packages (and their versions) available in this environment.

type: Optional[Literal["packages"]]

Package configuration type

defaultpackages
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

class BetaPackagesParams: type; apt; cargo; ... # 4 more

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: type: "self_hosted"

Configuration for self-hosted environments.

type: Literal["self_hosted"]

Environment type

class BetaSelfHostedConfigParams: type: "self_hosted"

Request params for self_hosted environment configuration.

type: Literal["self_hosted"]

Environment type

class BetaUnrestrictedNetwork: type: "unrestricted"

Unrestricted network access.

type: Literal["unrestricted"]

Network policy type

AmbientiLavoro

Ottieni elemento di lavoro
beta.environments.work.retrieve(work_id, **kwargs) -> BetaSelfHostedWork
GET/v1/environments/{environment_id}/work/{work_id}

Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.

Esegui polling del lavoro
beta.environments.work.poll(environment_id, **kwargs) -> BetaSelfHostedWork
GET/v1/environments/{environment_id}/work/poll

Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.

Conferma ricezione del lavoro
beta.environments.work.ack(work_id, **kwargs) -> BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/ack

Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.

Registra heartbeat
beta.environments.work.heartbeat(work_id, **kwargs) -> BetaSelfHostedWorkHeartbeatResponse
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat

Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.

Arresta lavoro
beta.environments.work.stop(work_id, **kwargs) -> BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/stop

Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.

Elenca gli elementi di lavoro
beta.environments.work.list(environment_id, **kwargs) -> SyncPageCursor[BetaSelfHostedWork]
GET/v1/environments/{environment_id}/work

Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.

Aggiorna elemento di lavoro
beta.environments.work.update(work_id, **kwargs) -> BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}

Nota: questi endpoint vengono chiamati automaticamente dal worker di ambiente predefinito fornito negli SDK e nella CLI, per orchestrare le sessioni con ambienti sandbox self-hosted. Sono inclusi qui come riferimento; non è necessario invocarli direttamente.

Ottieni statistiche della coda
beta.environments.work.stats(environment_id, **kwargs) -> BetaSelfHostedWorkQueueStats
GET/v1/environments/{environment_id}/work/stats

Ottieni statistiche sulla coda di lavoro per un ambiente.