Claude Platform Docs

環境

環境を作成
$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

指定された構成で新しい環境を作成します。

環境の一覧
$client->beta->environments->list(?bool includeArchived, ?int limit, ?string page, ?list<AnthropicBeta> betas, ?string workspaceID): PageCursor<BetaEnvironment>
GET/v1/environments

ページネーションをサポートして環境を一覧表示します。

環境を取得
$client->beta->environments->retrieve(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironment
GET/v1/environments/{environment_id}

IDで特定の環境を取得します。

環境を更新
$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}

既存の環境の構成を更新します。

環境を削除
$client->beta->environments->delete(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironmentDeleteResponse
DELETE/v1/environments/{environment_id}

IDで環境を削除します。削除の確認を返します。

環境をアーカイブ
$client->beta->environments->archive(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): BetaEnvironment
POST/v1/environments/{environment_id}/archive

IDで環境をアーカイブします。アーカイブされた環境は新しいセッションの作成に使用できません。

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

環境ワーク

ワークアイテムを取得
$client->beta->environments->work->retrieve(string workID, string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWork
GET/v1/environments/{environment_id}/work/{work_id}

注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。

ワークをポーリング
$client->beta->environments->work->poll(string environmentID, ?int blockMs, ?int reclaimOlderThanMs, ?list<AnthropicBeta> betas, ?string anthropicWorkerID): SelfHostedWork
GET/v1/environments/{environment_id}/work/poll

注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。

ワークを確認応答
$client->beta->environments->work->ack(string workID, string environmentID, ?list<AnthropicBeta> betas): SelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/ack

注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。

ハートビートを記録
$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

注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。

ワークを停止
$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

注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。

ワークアイテムの一覧
$client->beta->environments->work->list(string environmentID, ?int limit, ?string page, ?list<AnthropicBeta> betas): PageCursor<SelfHostedWork>
GET/v1/environments/{environment_id}/work

注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。

ワークアイテムを更新
$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}

注: これらのエンドポイントは、セルフホスト型サンドボックス環境でセッションをオーケストレーションするために、SDKおよびCLIで提供される事前構築済みの環境ワーカーによって自動的に呼び出されます。参考としてここに記載していますが、直接呼び出す必要はありません。

キューの統計を取得
$client->beta->environments->work->stats(string environmentID, ?list<AnthropicBeta> betas, ?string workspaceID): SelfHostedWorkQueueStats
GET/v1/environments/{environment_id}/work/stats

環境のワークキューに関する統計を取得します。