Claude Platform Docs

Ambienti

Crea ambiente
$client->beta->environments->create(string name, ?Config config, ?string description, ?array<string,string> metadata, ?Scope scope, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironment
POST/v1/environments

Crea un nuovo ambiente con la configurazione specificata.

Elenca gli ambienti
$client->beta->environments->list(?bool includeArchived, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<BetaEnvironment>
GET/v1/environments

Elenca gli ambienti con supporto per la paginazione.

Ottieni ambiente
$client->beta->environments->retrieve(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironment
GET/v1/environments/{environment_id}

Recupera un ambiente specifico tramite ID.

Aggiorna ambiente
$client->beta->environments->update(string environmentID, ?Config config, ?string description, ?array<string,string> metadata, ?string name, ?Scope scope, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironment
POST/v1/environments/{environment_id}

Aggiorna la configurazione di un ambiente esistente.

Elimina ambiente
$client->beta->environments->delete(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironmentDeleteResponse
DELETE/v1/environments/{environment_id}

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

Archivia ambiente
$client->beta->environments->archive(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): 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" type

Environment type

Networking networking

Network configuration policy.

BetaPackages packages

Package manager configuration.

class BetaCloudConfigParams { $type = 'cloud'; $networking; $packages; }
"cloud" type

Environment type

?Networking networking

Network configuration policy. Omit on update to preserve the existing value.

?BetaPackagesParams packages

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 BetaEnvironment { $type = 'environment'; $id; $archivedAt; /* 7 more */ }
"environment" type

The type of object (always 'environment')

string id

Environment identifier (e.g., 'env_...')

?string archivedAt

RFC 3339 timestamp when environment was archived, or null if not archived

Config config

Environment configuration (either Anthropic Cloud or self-hosted)

string createdAt

RFC 3339 timestamp when environment was created

?string description

User-provided description for the environment; null when unset

array<string,string> metadata

User-provided metadata key-value pairs

string name

Human-readable name for the environment

string updatedAt

RFC 3339 timestamp when environment was last updated

?Scope scope

The visibility scope for this environment. 'organization' means visible to all accounts. 'account' means visible only to the owning account.

class BetaEnvironmentDeleteResponse { $type; $id; }
Type type

The type of response

string id

Environment identifier

class BetaLimitedNetwork { $type = 'limited'; $allowMCPServers; $allowPackageManagers; $allowedHosts; }
"limited" type

Network policy type

bool allowMCPServers

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

bool allowPackageManagers

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

list<string> allowedHosts

Specifies domains the container can reach.

class BetaLimitedNetworkParams { $type = 'limited'; $allowMCPServers; $allowPackageManagers; $allowedHosts; }
"limited" type

Network policy type

?bool allowMCPServers

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

?bool allowPackageManagers

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.

?list<string> allowedHosts

Specifies domains the container can reach.

class BetaPackages { $type; $apt; $cargo; /* 4 more */ }
?Type type

Package configuration type

list<string> apt

Ubuntu/Debian packages to install

list<string> cargo

Rust packages to install

list<string> gem

Ruby packages to install

list<string> go

Go packages to install

list<string> npm

Node.js packages to install

list<string> pip

Python packages to install

class BetaPackagesParams { $type; $apt; $cargo; /* 4 more */ }
?Type type

Package configuration type

?list<string> apt

Ubuntu/Debian packages to install

?list<string> cargo

Rust packages to install

?list<string> gem

Ruby packages to install

?list<string> go

Go packages to install

?list<string> npm

Node.js packages to install

?list<string> pip

Python packages to install

class BetaSelfHostedConfig { $type = 'self_hosted'; }
"self_hosted" type

Environment type

class BetaSelfHostedConfigParams { $type = 'self_hosted'; }
"self_hosted" type

Environment type

class BetaUnrestrictedNetwork { $type = 'unrestricted'; }
"unrestricted" type

Network policy type

AmbientiLavoro

Ottieni elemento di lavoro
$client->beta->environments->work->retrieve(string workID, string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWork
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
$client->beta->environments->work->poll(string environmentID, ?int blockMs, ?int reclaimOlderThanMs, ?list<AnthropicBeta> betas, ?string anthropicWorkerID): SelfHostedWork
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
$client->beta->environments->work->ack(string workID, string environmentID, ?list<AnthropicBeta> betas): SelfHostedWork
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
$client->beta->environments->work->heartbeat(string workID, string environmentID, ?int desiredTTLSeconds, ?string expectedLastHeartbeat, ?list<AnthropicBeta> betas): SelfHostedWorkHeartbeatResponse
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
$client->beta->environments->work->stop(string workID, string environmentID, ?bool force, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWork
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
$client->beta->environments->work->list(string environmentID, ?int limit, ?string page, ?list<AnthropicBeta> betas): PageCursor<SelfHostedWork>
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
$client->beta->environments->work->update(string workID, string environmentID, array<string,string> metadata, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWork
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
$client->beta->environments->work->stats(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWorkQueueStats
GET/v1/environments/{environment_id}/work/stats

Ottieni statistiche sulla coda di lavoro per un ambiente.