Claude Platform Docs

Ambientes

Criar ambiente
$ ant beta:environments create
POST/v1/environments

Crie um novo ambiente com a configuração especificada.

Listar ambientes
$ ant beta:environments list
GET/v1/environments

Liste ambientes com suporte a paginação.

Obter ambiente
$ ant beta:environments retrieve
GET/v1/environments/{environment_id}

Recupere um ambiente específico por ID.

Atualizar ambiente
$ ant beta:environments update
POST/v1/environments/{environment_id}

Atualize a configuração de um ambiente existente.

Excluir ambiente
$ ant beta:environments delete
DELETE/v1/environments/{environment_id}

Exclua um ambiente por ID. Retorna uma confirmação da exclusão.

Arquivar ambiente
$ ant beta:environments archive
POST/v1/environments/{environment_id}/archive

Arquive um ambiente por ID. Ambientes arquivados não podem ser usados para criar novas sessões.

Models
beta_cloud_config: object{ type: "cloud", networking, packages }

cloud environment configuration.

beta_cloud_config_params: object{ type: "cloud", networking, packages }

Request params for cloud environment configuration.

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

beta_environment: object{ type: "environment", id, archived_at, 7 more }

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

beta_environment_archived_error_details: object{ error_code }
error_code: "environment_archived"
beta_environment_create_disabled_error_details: object{ error_code }
error_code: "environment_create_disabled"
beta_environment_delete_response: object{ type: "environment_deleted", id }

Response after deleting an environment.

type: "environment_deleted"

The type of response

id: string

Environment identifier

beta_environment_not_found_error_details: object{ error_code }
error_code: "environment_not_found"
beta_environment_update_disabled_error_details: object{ error_code }
error_code: "environment_update_disabled"
beta_invalid_config_type_change_error_details: object{ error_code }
error_code: "invalid_config_type_change"
beta_invalid_metadata_error_details: object{ error_code }
error_code: "invalid_metadata"
beta_limited_network: object{ type: "limited", allow_mcp_servers, allow_package_managers, allowed_hosts }

Limited network access.

type: "limited"

Network policy type

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 of string

Specifies domains the container can reach.

beta_limited_network_params: object{ type: "limited", 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: optional boolean

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: optional boolean

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: optional array of string

Specifies domains the container can reach.

beta_packages: object{ type: "packages", apt, cargo, 4 more }

Packages (and their versions) available in this environment.

type: optional "packages"

Package configuration type

apt: array of string

Ubuntu/Debian packages to install

cargo: array of string

Rust packages to install

gem: array of string

Ruby packages to install

go: array of string

Go packages to install

npm: array of string

Node.js packages to install

pip: array of string

Python packages to install

beta_packages_params: object{ type: "packages", 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.

type: optional "packages"

Package configuration type

apt: optional array of string

Ubuntu/Debian packages to install

cargo: optional array of string

Rust packages to install

gem: optional array of string

Ruby packages to install

go: optional array of string

Go packages to install

npm: optional array of string

Node.js packages to install

pip: optional array of string

Python packages to install

beta_self_hosted_config: object{ type: "self_hosted" }

Configuration for self-hosted environments.

type: "self_hosted"

Environment type

beta_self_hosted_config_params: object{ type: "self_hosted" }

Request params for self_hosted environment configuration.

type: "self_hosted"

Environment type

beta_unrestricted_network: object{ type: "unrestricted" }

Unrestricted network access.

type: "unrestricted"

Network policy type

Errors
"environment_archived"⁠HTTP status 400

The environment is archived, so it cannot be updated.

details: object{ error_code }
error_code: "environment_archived"
"invalid_config_type_change"⁠HTTP status 400

config.type differs from the environment's stored type, which cannot change after creation.

details: object{ error_code }
error_code: "invalid_config_type_change"
"invalid_metadata"⁠HTTP status 400

metadata has too many keys, a key or value that is too long, or a reserved key. The message names each problem.

details: object{ error_code }
error_code: "invalid_metadata"
"environment_create_disabled"⁠HTTP status 403

Anthropic has turned off creating environments for this organization. Existing environments still work.

details: object{ error_code }
error_code: "environment_create_disabled"
"environment_update_disabled"⁠HTTP status 403

Anthropic has turned off updating environments for this organization. Existing environments still work as they are.

details: object{ error_code }
error_code: "environment_update_disabled"
"environment_not_found"⁠HTTP status 404

settings.environment_id names no Environment within the organization's reach.

details: object{ error_code }
error_code: "environment_not_found"

AmbientesTrabalho

Obter item de trabalho
$ ant beta:environments:work retrieve
GET/v1/environments/{environment_id}/work/{work_id}

Recupere informações detalhadas sobre um item de trabalho específico.

Fazer polling por trabalho
$ ant beta:environments:work poll
GET/v1/environments/{environment_id}/work/poll

Observação: esses endpoints são chamados automaticamente pelo worker de ambiente pré-construído fornecido nos SDKs e na CLI, para orquestrar sessões com ambientes sandbox auto-hospedados. Eles estão incluídos aqui como referência; você não precisa invocá-los diretamente.

Confirmar recebimento de trabalho
$ ant beta:environments:work ack
POST/v1/environments/{environment_id}/work/{work_id}/ack

Observação: esses endpoints são chamados automaticamente pelo worker de ambiente pré-construído fornecido nos SDKs e na CLI, para orquestrar sessões com ambientes sandbox auto-hospedados. Eles estão incluídos aqui como referência; você não precisa invocá-los diretamente.

Registrar heartbeat
$ ant beta:environments:work heartbeat
POST/v1/environments/{environment_id}/work/{work_id}/heartbeat

Observação: esses endpoints são chamados automaticamente pelo worker de ambiente pré-construído fornecido nos SDKs e na CLI, para orquestrar sessões com ambientes sandbox auto-hospedados. Eles estão incluídos aqui como referência; você não precisa invocá-los diretamente.

Parar trabalho
$ ant beta:environments:work stop
POST/v1/environments/{environment_id}/work/{work_id}/stop

Pare um item de trabalho, iniciando um desligamento gracioso ou forçado.

Listar itens de trabalho
$ ant beta:environments:work list
GET/v1/environments/{environment_id}/work

Liste itens de trabalho em um ambiente.

Atualizar item de trabalho
$ ant beta:environments:work update
POST/v1/environments/{environment_id}/work/{work_id}

Atualize os metadados do item de trabalho com semântica de mesclagem (merge).

Obter estatísticas da fila
$ ant beta:environments:work stats
GET/v1/environments/{environment_id}/work/stats

Obtenha estatísticas sobre a fila de trabalho de um ambiente.