Documentation
¶
Overview ¶
Self-hosted example: point the SDK at a self-hosted E2B control plane (runtime <= 2026.30, including pre-2025.31 deployments) and inspect the sandbox session (ID, template, state, timing, envd info, live metrics).
Self-hosted releases through runtime 2026.30 expose POST /sandboxes rather than E2B Cloud's POST /v2/sandboxes, so this example calls client.CreateV1 (which defaults secure=true so the server mints an EnvdAccessToken; pass Insecure: true only for legacy pre-0.2.0 envd templates).
Usage:
E2B_API_KEY=... # team API key issued by your self-hosted cluster
E2B_DOMAIN=e2b.example.com # your self-hosted domain; APIs resolve to
# https://api.<domain> and sandboxes to
# https://49983-<id>.<domain> unless overridden.
E2B_API_URL=https://api.e2b.example.com # optional full override
go run ./examples/selfhosted