E2B Code Interpreter SDK that runs inside Vercel's Functions.
- Get API key from the dashboard.
- Create
.env.local
file in the root of the project and add the API key:
E2B_API_KEY=your_e2b_api_key
npm install
npm run dev
This project exposes 4 API endpoints:
POST /api/sandbox/create
- create a new sandboxPOST /api/sandbox/run-code
- run code in the sandboxPOST /api/sandbox/kill
- kills the sandbox- TODO:
POST /api/sandbox/upload
- uploads a file to the sandbox
You can find the implementation of the API endpoints in the app/api
folder.