Skip to content

List Environments

GET/v1/environments

List environments owned by your organization, ordered most-recently-created first. Returns a page of Environment objects with an opaque cursor for the next page.

Query Parameters

ParameterTypeRequiredDescription
limitintegerPage size. Default 20, max 100.
pagestringOpaque cursor from a previous response's next_page.
include_archivedbooleanInclude archived environments. Default false.

Request Examples

python
from anthropic import Anthropic

client = Anthropic(
    api_key="sk-sb-YOUR_KEY",
    base_url="https://api.sandbase.ai"
)

page = client.beta.environments.list(limit=20)
for env in page.data:
    print(f"{env.id}{env.name}")
bash
curl "https://api.sandbase.ai/v1/environments?limit=20" \
  -H "Authorization: Bearer sk-sb-YOUR_KEY"

Response

json
{
  "data": [
    {
      "id": "env_011CZkZ9X2dpNyB7HsEFoRfW",
      "type": "environment",
      "name": "python-data-analysis",
      "description": "Python environment with data-analysis packages.",
      "config": {
        "type": "cloud",
        "networking": {
          "type": "limited",
          "allowed_hosts": ["api.example.com"],
          "allow_mcp_servers": false,
          "allow_package_managers": true
        },
        "packages": {
          "type": "packages",
          "apt": [], "cargo": [], "gem": [], "go": [], "npm": [],
          "pip": ["pandas", "numpy"]
        }
      },
      "metadata": {},
      "archived_at": null,
      "created_at": "2026-05-29T10:00:00Z",
      "updated_at": "2026-05-29T10:00:00Z"
    }
  ],
  "next_page": "page_eyJjIjoiMjAyNi0wNS0yOVQxMDowMDowMFoiLCJpIjoiZW52XzAxMSJ9"
}

Pagination

Results are ordered by created_at descending (ties broken by id). When more results exist, the response includes a next_page cursor; pass it back as the page parameter. When next_page is absent, you've reached the last page.

Errors

StatusTypeDescription
400invalid_requestInvalid page cursor
401authentication_errorInvalid or missing API key