Claude Platform Docs

Umgebungen

Umgebung erstellen
$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

Erstelle eine neue Umgebung mit der angegebenen Konfiguration.

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

Liste Umgebungen mit Unterstützung für Paginierung auf.

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

Rufe eine bestimmte Umgebung anhand ihrer ID ab.

Umgebung aktualisieren
$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}

Aktualisiere die Konfiguration einer bestehenden Umgebung.

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

Lösche eine Umgebung anhand ihrer ID. Gibt eine Bestätigung der Löschung zurück.

Umgebung archivieren
$client->beta->environments->archive(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironment
POST/v1/environments/{environment_id}/archive

Archiviere eine Umgebung anhand ihrer ID. Archivierte Umgebungen können nicht zum Erstellen neuer Sessions verwendet werden.

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

UmgebungenArbeit

Arbeitselement abrufen
$client->beta->environments->work->retrieve(string workID, string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWork
GET/v1/environments/{environment_id}/work/{work_id}

Hinweis: Diese Endpunkte werden automatisch vom vorgefertigten Environment-Worker aufgerufen, der in den SDKs und der CLI bereitgestellt wird, um Sessions mit selbst gehosteten Sandbox-Umgebungen zu orchestrieren. Sie sind hier als Referenz aufgeführt; du musst sie nicht direkt aufrufen.

Arbeit per Polling abfragen
$client->beta->environments->work->poll(string environmentID, ?int blockMs, ?int reclaimOlderThanMs, ?list<AnthropicBeta> betas, ?string anthropicWorkerID): SelfHostedWork
GET/v1/environments/{environment_id}/work/poll

Hinweis: Diese Endpunkte werden automatisch vom vorgefertigten Environment-Worker aufgerufen, der in den SDKs und der CLI bereitgestellt wird, um Sessions mit selbst gehosteten Sandbox-Umgebungen zu orchestrieren. Sie sind hier als Referenz aufgeführt; du musst sie nicht direkt aufrufen.

Arbeit bestätigen
$client->beta->environments->work->ack(string workID, string environmentID, ?list<AnthropicBeta> betas): SelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/ack

Hinweis: Diese Endpunkte werden automatisch vom vorgefertigten Environment-Worker aufgerufen, der in den SDKs und der CLI bereitgestellt wird, um Sessions mit selbst gehosteten Sandbox-Umgebungen zu orchestrieren. Sie sind hier als Referenz aufgeführt; du musst sie nicht direkt aufrufen.

Heartbeat aufzeichnen
$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

Hinweis: Diese Endpunkte werden automatisch vom vorgefertigten Environment-Worker aufgerufen, der in den SDKs und der CLI bereitgestellt wird, um Sessions mit selbst gehosteten Sandbox-Umgebungen zu orchestrieren. Sie sind hier als Referenz aufgeführt; du musst sie nicht direkt aufrufen.

Arbeit stoppen
$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

Hinweis: Diese Endpunkte werden automatisch vom vorgefertigten Environment-Worker aufgerufen, der in den SDKs und der CLI bereitgestellt wird, um Sessions mit selbst gehosteten Sandbox-Umgebungen zu orchestrieren. Sie sind hier als Referenz aufgeführt; du musst sie nicht direkt aufrufen.

Arbeitselemente auflisten
$client->beta->environments->work->list(string environmentID, ?int limit, ?string page, ?list<AnthropicBeta> betas): PageCursor<SelfHostedWork>
GET/v1/environments/{environment_id}/work

Hinweis: Diese Endpunkte werden automatisch vom vorgefertigten Environment-Worker aufgerufen, der in den SDKs und der CLI bereitgestellt wird, um Sessions mit selbst gehosteten Sandbox-Umgebungen zu orchestrieren. Sie sind hier als Referenz aufgeführt; du musst sie nicht direkt aufrufen.

Arbeitselement aktualisieren
$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}

Hinweis: Diese Endpunkte werden automatisch vom vorgefertigten Environment-Worker aufgerufen, der in den SDKs und der CLI bereitgestellt wird, um Sessions mit selbst gehosteten Sandbox-Umgebungen zu orchestrieren. Sie sind hier als Referenz aufgeführt; du musst sie nicht direkt aufrufen.

Warteschlangenstatistiken abrufen
$client->beta->environments->work->stats(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWorkQueueStats
GET/v1/environments/{environment_id}/work/stats

Rufe Statistiken über die Arbeitswarteschlange einer Umgebung ab.