Claude Platform Docs

環境

環境を作成
BetaEnvironment beta().environments().create(params, requestOptions = RequestOptions.none())
POST/v1/environments

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

環境の一覧
EnvironmentListPage beta().environments().list(params = EnvironmentListParams.none(), requestOptions = RequestOptions.none())
GET/v1/environments

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

環境を取得
BetaEnvironment beta().environments().retrieve(params = EnvironmentRetrieveParams.none(), requestOptions = RequestOptions.none())
GET/v1/environments/{environment_id}

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

環境を更新
BetaEnvironment beta().environments().update(params = EnvironmentUpdateParams.none(), requestOptions = RequestOptions.none())
POST/v1/environments/{environment_id}

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

環境を削除
BetaEnvironmentDeleteResponse beta().environments().delete(params = EnvironmentDeleteParams.none(), requestOptions = RequestOptions.none())
DELETE/v1/environments/{environment_id}

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

環境をアーカイブ
BetaEnvironment beta().environments().archive(params = EnvironmentArchiveParams.none(), requestOptions = RequestOptions.none())
POST/v1/environments/{environment_id}/archive

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

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; archivedAt; /* 7 more */ }

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

class BetaEnvironmentDeleteResponse { type; id; }

Response after deleting an environment.

Type type

The type of response

String id

Environment identifier

class BetaLimitedNetwork { type = "limited"; allowMcpServers; allowPackageManagers; allowedHosts; }

Limited network access.

JsonValue type = "limited"

Network policy type

boolean allowMcpServers

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

boolean 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 network request params.

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

JsonValue type = "limited"

Network policy type

Optional<Boolean> allowMcpServers

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

Optional<Boolean> 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.

Optional<List<String>> allowedHosts

Specifies domains the container can reach.

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

Packages (and their versions) available in this environment.

Optional<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 */ }

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.

Optional<Type> type

Package configuration type

Optional<List<String>> apt

Ubuntu/Debian packages to install

Optional<List<String>> cargo

Rust packages to install

Optional<List<String>> gem

Ruby packages to install

Optional<List<String>> go

Go packages to install

Optional<List<String>> npm

Node.js packages to install

Optional<List<String>> pip

Python packages to install

class BetaSelfHostedConfig { type = "self_hosted"; }

Configuration for self-hosted environments.

JsonValue type = "self_hosted"

Environment type

class BetaSelfHostedConfigParams { type = "self_hosted"; }

Request params for self_hosted environment configuration.

JsonValue type = "self_hosted"

Environment type

class BetaUnrestrictedNetwork { type = "unrestricted"; }

Unrestricted network access.

JsonValue type = "unrestricted"

Network policy type

環境ワーク

ワークアイテムを取得
BetaSelfHostedWork beta().environments().work().retrieve(params, requestOptions = RequestOptions.none())
GET/v1/environments/{environment_id}/work/{work_id}

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

ワークをポーリング
BetaSelfHostedWork beta().environments().work().poll(params = WorkPollParams.none(), requestOptions = RequestOptions.none())
GET/v1/environments/{environment_id}/work/poll

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

ワークを確認応答
BetaSelfHostedWork beta().environments().work().ack(params, requestOptions = RequestOptions.none())
POST/v1/environments/{environment_id}/work/{work_id}/ack

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

ハートビートを記録
BetaSelfHostedWorkHeartbeatResponse beta().environments().work().heartbeat(params, requestOptions = RequestOptions.none())
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat

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

ワークを停止
BetaSelfHostedWork beta().environments().work().stop(params, requestOptions = RequestOptions.none())
POST/v1/environments/{environment_id}/work/{work_id}/stop

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

ワークアイテムの一覧
WorkListPage beta().environments().work().list(params = WorkListParams.none(), requestOptions = RequestOptions.none())
GET/v1/environments/{environment_id}/work

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

ワークアイテムを更新
BetaSelfHostedWork beta().environments().work().update(params, requestOptions = RequestOptions.none())
POST/v1/environments/{environment_id}/work/{work_id}

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

キューの統計を取得
BetaSelfHostedWorkQueueStats beta().environments().work().stats(params = WorkStatsParams.none(), requestOptions = RequestOptions.none())
GET/v1/environments/{environment_id}/work/stats

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