e2b-dev/e2b-cookbook

Examples of using E2B

What it solves

The E2B Cookbook provides a library of practical examples and guides for developers who want to integrate E2B sandboxes into their AI applications. It helps bridge the gap between AI models and real-world execution environments, allowing developers to see how to safely run code, analyze data, and manage agent workflows in isolated environments.

How it works

The repository contains a collection of code snippets and full-stack examples organized by AI provider, framework, and use case. Each example demonstrates how to use the E2B SDK to spin up a secure, sandboxed environment where an AI can execute code, install dependencies, or interact with external tools. The project also includes a nightly test suite that verifies these examples against the live E2B platform to ensure they remain functional.

Who it’s for

This project is for developers building AI agents, coding assistants, or data analysis tools who need a reliable way to let their models execute code or interact with a filesystem without compromising system security.

Highlights

  • Extensive library of code examples for Python and TypeScript.
  • Integrations with major AI frameworks like LangChain, LangGraph, Pydantic AI, and Vercel AI SDK.
  • Support for various LLM providers including OpenAI, Anthropic, Mistral, and Groq.
  • Practical use cases ranging from data visualization and web scraping to reinforcement learning and browser automation.
  • Automated nightly testing to ensure all examples remain compatible with the latest E2B SDK updates.

Related

  • Project
  • Project
  • Project
  • Project