Create Environment
Create a new environment with the specified configuration.
post/v1/environments?beta=true
Headers
anthropic-betastring
Optional header to specify the beta version(s) you want to use.
To use multiple betas, use a comma separated list like beta1,beta2 or specify the header multiple times for each beta.
Optional header to specify the beta version(s) you want to use.
To use multiple betas, use a comma separated list like beta1,beta2 or specify the header multiple times for each beta.
Request body
Example request
{
"name": "python-data-analysis",
"description": "Python environment with data-analysis packages.",
"config": {
"type": "cloud",
"networking": {
"type": "limited",
"allowed_hosts": [
"api.example.com"
],
"allow_package_managers": true
},
"packages": {
"pip": [
"pandas",
"numpy"
]
}
}
}Response
Successful Response
Example response
{
"type": "environment",
"id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
"name": "python-data-analysis",
"description": "Python environment with data-analysis packages.",
"config": {
"type": "cloud",
"networking": {
"type": "limited",
"allowed_hosts": [
"api.example.com"
],
"allow_package_managers": true,
"allow_mcp_servers": false
},
"packages": {
"type": "packages",
"pip": [
"pandas",
"numpy"
],
"npm": [],
"apt": [],
"cargo": [],
"gem": [],
"go": []
}
},
"metadata": {},
"archived_at": null,
"created_at": "2026-03-15T10:00:00Z",
"updated_at": "2026-03-15T10:00:00Z"
}