Documentation
¶
Overview ¶
Lifecycle example for self-hosted E2B control planes (required on runtime < 2025.44 and still actively served across all self-hosted runtime <= 2026.30; note that POST /v2/templates is retired with 410 Gone on E2B Cloud, whereas ListV1, SetPublicV1, and CreateV1 are soft-deprecated in OpenAPI and remain served on both self-hosted and E2B Cloud).
Compared with ../lifecycle (which targets E2B Cloud), this example uses the legacy endpoints required on older self-hosted servers:
- cli.ListV1 (GET /templates, required on runtime < 2026.26)
- cli.BuildStreamV2 (POST /v2/templates, required on runtime < 2025.44)
- cli.SetPublicV1 (PATCH /templates/{id}, required on runtime < 2026.05)
- client.CreateV1 (POST /sandboxes, required on runtime <= 2026.30)
Usage:
# On early self-hosted clusters (< 2025.44), set both E2B_API_KEY (used by # BuildStreamV2) and E2B_ACCESS_TOKEN (used by ListV1 / SetPublicV1 / Delete). source ./.env && go run ./examples/lifecycle_v2