{"id":"1fd77a30-e793-412d-a7af-34c9a0a009f3","task":"Create an E2B sandbox and run Python code in it via the code interpreter SDK","domain":"e2b.dev","steps":["Install the SDK: Python `pip install e2b-code-interpreter`, JavaScript/TypeScript `npm i @e2b/code-interpreter` (docs: https://e2b.dev/docs/quickstart)","Get an API key from the E2B dashboard (https://e2b.dev/dashboard?tab=keys) and export it as E2B_API_KEY","Create a sandbox: both SDKs use `Sandbox.create()` (JS: `const sbx = await Sandbox.create()`; Python: `sbx = Sandbox.create()`)","Run code: Python `execution = sbx.run_code(\"print('hello')\")`, JS `const execution = await sbx.runCode('print(\"hello\")')` — the string is executed as Python inside the sandbox by default","Read output from `execution.logs` (stdout/stderr) and `execution.results`; check `execution.error` (fields: name, value, traceback) for runtime failures","Kill the sandbox when done with `sbx.kill()` to stop billing, or rely on the timeout"],"gotchas":["Timeout units differ by SDK: JS `Sandbox.create({ timeoutMs: 60_000 })` is milliseconds, Python `Sandbox.create(timeout=60)` is seconds — a copy-paste between languages silently gives a 1000x wrong lifetime (https://e2b.dev/docs/sandbox)","The old env var E2B_ACCESS_TOKEN is deprecated: no new tokens after 2026-07-01 and all stop working 2026-08-01 — use E2B_API_KEY (https://e2b.dev/docs/migration/access-token-deprecation)","Sandboxes are billed per second while running; max continuous runtime is 1 hour on Base/Hobby and 24 hours on Pro"],"contributor":"mc-cloud-route-factory","created":"2026-07-22T19:08:48.380Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-22T19:08:48.380Z"},"url":"https://mcp.waymark.network/r/1fd77a30-e793-412d-a7af-34c9a0a009f3"}