Claude Platform Docs

Environments

Create Environment
client.beta.environments.create(EnvironmentCreateParamsparams, RequestOptionsoptions?): BetaEnvironment
POST/v1/environments
List Environments
client.beta.environments.list(EnvironmentListParamsparams?, RequestOptionsoptions?): PageCursor<BetaEnvironment>
GET/v1/environments
Get Environment
client.beta.environments.retrieve(stringenvironmentID, EnvironmentRetrieveParamsparams?, RequestOptionsoptions?): BetaEnvironment
GET/v1/environments/{environment_id}
Update Environment
client.beta.environments.update(stringenvironmentID, EnvironmentUpdateParamsparams, RequestOptionsoptions?): BetaEnvironment
POST/v1/environments/{environment_id}
Delete Environment
client.beta.environments.delete(stringenvironmentID, EnvironmentDeleteParamsparams?, RequestOptionsoptions?): BetaEnvironmentDeleteResponse
DELETE/v1/environments/{environment_id}
Archive Environment
client.beta.environments.archive(stringenvironmentID, EnvironmentArchiveParamsparams?, RequestOptionsoptions?): BetaEnvironment
POST/v1/environments/{environment_id}/archive
Models
BetaCloudConfig { networking, packages, type }

cloud environment configuration.

BetaCloudConfigParams { type, networking, packages }

Request params for cloud environment configuration.

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

BetaEnvironment { id, archived_at, config, 7 more }

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

BetaEnvironmentDeleteResponse { id, type }

Response after deleting an environment.

id: string

Environment identifier

type: "environment_deleted"

The type of response

defaultenvironment_deleted
BetaLimitedNetwork { allow_mcp_servers, allow_package_managers, allowed_hosts, type }

Limited network access.

allow_mcp_servers: boolean

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

allow_package_managers: boolean

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

allowed_hosts: Array<string>

Specifies domains the container can reach.

type: "limited"

Network policy type

BetaLimitedNetworkParams { type, 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: "limited"

Network policy type

allow_mcp_servers?: boolean | null

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?: boolean | null

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?: Array<string> | null

Specifies domains the container can reach.

BetaPackages { apt, cargo, gem, 4 more }

Packages (and their versions) available in this environment.

apt: Array<string>

Ubuntu/Debian packages to install

cargo: Array<string>

Rust packages to install

gem: Array<string>

Ruby packages to install

go: Array<string>

Go packages to install

npm: Array<string>

Node.js packages to install

pip: Array<string>

Python packages to install

type?: "packages"

Package configuration type

defaultpackages
BetaPackagesParams { apt, cargo, gem, 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.

BetaSelfHostedConfig { type }

Configuration for self-hosted environments.

type: "self_hosted"

Environment type

BetaSelfHostedConfigParams { type }

Request params for self_hosted environment configuration.

type: "self_hosted"

Environment type

BetaUnrestrictedNetwork { type }

Unrestricted network access.

type: "unrestricted"

Network policy type

EnvironmentsWork

Get Work Item
client.beta.environments.work.retrieve(stringworkID, WorkRetrieveParamsparams, RequestOptionsoptions?): BetaSelfHostedWork
GET/v1/environments/{environment_id}/work/{work_id}
Poll for Work
client.beta.environments.work.poll(stringenvironmentID, WorkPollParamsparams?, RequestOptionsoptions?): BetaSelfHostedWork | null
GET/v1/environments/{environment_id}/work/poll
Acknowledge Work
client.beta.environments.work.ack(stringworkID, WorkAckParamsparams, RequestOptionsoptions?): BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/ack
Record Heartbeat
client.beta.environments.work.heartbeat(stringworkID, WorkHeartbeatParamsparams, RequestOptionsoptions?): BetaSelfHostedWorkHeartbeatResponse
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat
Stop Work
client.beta.environments.work.stop(stringworkID, WorkStopParamsparams, RequestOptionsoptions?): BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}/stop
List Work Items
client.beta.environments.work.list(stringenvironmentID, WorkListParamsparams?, RequestOptionsoptions?): PageCursor<BetaSelfHostedWork>
GET/v1/environments/{environment_id}/work
Update Work Item
client.beta.environments.work.update(stringworkID, WorkUpdateParamsparams, RequestOptionsoptions?): BetaSelfHostedWork
POST/v1/environments/{environment_id}/work/{work_id}
Get Queue Statistics
client.beta.environments.work.stats(stringenvironmentID, WorkStatsParamsparams?, RequestOptionsoptions?): BetaSelfHostedWorkQueueStats
GET/v1/environments/{environment_id}/work/stats