Anthropic Environments API

Container configuration for agent sessions

Operations 19

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

POST /v1/environments/{environment_id}/archive?beta=true Archive an environment so no new sessions use it · Archive Environment #
Ask an LLM
“How do I stop an environment from being used for new agent sessions?”
“What happens to an environment once I archive it with the beta flag?”
Tell an agent
Archive environment {environment_id} via the beta flag so it can't start new sessions.
Retire beta environment {environment_id} from new session use.
GET /v1/environments/{environment_id}/work/poll?beta=true Poll an environment's queue for new work · Poll for Work #
Ask an LLM
“How does a self-hosted sandbox worker pick up the next piece of work for an environment?”
“Can a worker long-poll for work and reclaim items that were left unfinished?”
Tell an agent
Poll environment {environment_id} for the next work item, waiting up to {block_ms} ms.
As worker {worker_id}, pull work from environment {environment_id} and reclaim items older than {reclaim_older_than_ms} ms.
GET /v1/environments/{environment_id}/work/stats?beta=true Get work queue statistics for an environment · Get Queue Statistics #
Ask an LLM
“How backed up is the work queue for my sandbox environment?”
“Where can I see queue statistics for a self-hosted environment?”
Tell an agent
Show queue statistics for environment {environment_id}.
Report how much work is waiting in environment {environment_id}'s queue.
POST /v1/environments/{environment_id}/work/{work_id}/ack?beta=true Acknowledge a work item a worker picked up · Acknowledge Work #
Ask an LLM
“How does a worker confirm it has claimed a work item from the environment queue?”
“Do I need to acknowledge work after polling it in a self-hosted sandbox?”
Tell an agent
Acknowledge work item {work_id} in environment {environment_id}.
Confirm receipt of environment {environment_id} work {work_id}.
POST /v1/environments/{environment_id}/work/{work_id}/heartbeat?beta=true Send a heartbeat to keep a work item leased · Record Heartbeat #
Ask an LLM
“How does a worker keep its lease on a long-running work item alive?”
“Can a heartbeat ask for a longer time-to-live on the work item?”
Tell an agent
Record a heartbeat for work {work_id} in environment {environment_id}.
Extend the lease on environment {environment_id} work {work_id} to {desired_ttl_seconds} seconds.
POST /v1/environments/{environment_id}/work/{work_id}/stop?beta=true Stop a work item in an environment · Stop Work #
Ask an LLM
“How do I halt a work item that's running in a self-hosted environment?”
“Can I force-stop a work item instead of letting it wind down?”
Tell an agent destructive · confirm first
Stop work item {work_id} in environment {environment_id}.
Force-stop environment {environment_id} work {work_id} with force set to {force}.
GET /v1/environments/{environment_id}/work/{work_id}?beta=true Get one work item from an environment · Get Work Item #
Ask an LLM
“What is the current state of a specific work item in my environment?”
“Can I look up a single queued work item by its ID?”
Tell an agent
Get work item {work_id} from environment {environment_id}.
Show the details of environment {environment_id} work {work_id}.
POST /v1/environments/{environment_id}/work/{work_id}?beta=true Update a work item's metadata · Update Work Item #
Ask an LLM
“Can I attach or change metadata on a work item in an environment queue?”
“Where do I update the metadata a worker keeps on a work item?”
Tell an agent
Set metadata {metadata} on work item {work_id} in environment {environment_id}.
Update environment {environment_id} work {work_id} metadata to {metadata}.
GET /v1/environments/{environment_id}/work?beta=true List work items in an environment · List Work Items #
Ask an LLM
“Which work items are queued or running in my sandbox environment?”
“Can I page through all work items for an environment?”
Tell an agent
List the work items in environment {environment_id}.
Show {limit} work items per page for environment {environment_id}.
GET /v1/environments/{environment_id}?beta=true Get an environment via the beta flag · Get Environment #
Ask an LLM
“How do I read an environment's configuration with the beta environments endpoint?”
“What settings does the beta API return for a single environment?”
Tell an agent
Get beta environment {environment_id}.
Fetch environment {environment_id} with the beta query flag.
POST /v1/environments/{environment_id}?beta=true Update an environment's configuration · Update Environment #
Ask an LLM
“Can I rename an environment or change its description?”
“Is it possible to change an existing environment's config or scope?”
Tell an agent
Rename environment {environment_id} to {name}.
Replace the config of environment {environment_id} with {config}.
DELETE /v1/environments/{environment_id}?beta=true Delete an environment via the beta flag · Delete Environment #
Ask an LLM
“How do I permanently delete an environment using the beta endpoint?”
“Does deleting an environment with the beta flag return a confirmation?”
Tell an agent destructive · confirm first
Delete beta environment {environment_id}.
Permanently remove environment {environment_id} through the beta flag.
POST /v1/environments?beta=true Create an environment with config and scope · Create Environment #
Ask an LLM
“How do I set up a new environment for agent sessions with the beta flag?”
“Can I give a new environment a description, scope and metadata when I create it?”
Tell an agent
Create a beta environment named {name}.
Create environment {name} with config {config} and scope {scope}.
GET /v1/environments?beta=true List environments, optionally including archived · List Environments #
Ask an LLM
“Which sandbox environments do I have, including archived ones?”
“Can the beta environment listing be paginated?”
Tell an agent
List my environments with archived included set to {include_archived}.
Show {limit} environments per page from the beta listing.
POST /v1/environments Create a container config on the plain endpoint · Anthropic Create Environment #
Ask an LLM
“How do I create a container configuration for sessions without the beta query flag?”
“Which fields are required to create an environment on the plain endpoint?”
Tell an agent
On the plain endpoint, create container config {name} using {config}.
Without the beta flag, set up a session container called {name} with settings {config}.
GET /v1/environments List environments on the plain endpoint · Anthropic List Environments #
Ask an LLM
“What's the paginated environment list on /v1/environments without the beta query flag?”
“Can I list environments through the plain endpoint using a specific beta header?”
Tell an agent
Using the plain endpoint with beta header {anthropic_beta}, list my environments.
List environments without the beta query flag, sending API version {anthropic_version}.
GET /v1/environments/{environment_id} Get an environment on the plain endpoint · Anthropic Get Environment #
Ask an LLM
“What's the non-beta-flag call to read one environment by ID?”
“Can I retrieve an environment from /v1/environments without the beta query parameter?”
Tell an agent
Look up environment {environment_id} on the plain endpoint.
Without the beta parameter, retrieve environment {environment_id}.
DELETE /v1/environments/{environment_id} Delete an environment on the plain endpoint · Anthropic Delete Environment #
Ask an LLM
“What's the non-beta-flag way to delete an environment?”
“Can I delete environments from the plain /v1/environments path?”
Tell an agent destructive · confirm first
Delete environment {environment_id} using the plain endpoint.
Without the beta parameter, erase environment {environment_id}.
POST /v1/environments/{environment_id}/archive Archive an environment on the plain endpoint · Anthropic Archive Environment #
Ask an LLM
“Can I archive an environment without adding the beta query flag?”
“Where is the plain archive path for environments?”
Tell an agent
Archive environment {environment_id} on the plain endpoint.
Without the beta parameter, mark environment {environment_id} archived.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/anthropic-environments-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

anthropic-environments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Anthropic Environments API
  version: '1.0'
  description: 'Operations tagged Environments across 2 of this provider''s published API definitions: anthropic-api-openapi.json, anthropic-managed-agents-api-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.anthropic.com
tags:


# --- truncated at 32 KB (84 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/anthropic/refs/heads/main/openapi/anthropic-environments-api-openapi.yml