Overview
The Koyeb Sandbox SDK provides a Python interface for programmatically creating, managing, and interacting with Koyeb sandboxes — ephemeral compute environments designed for isolated code execution on the Koyeb platform.
Why use sandboxes?
A sandbox is an isolated, ephemeral environment designed to safely run, test, and experiment with code without affecting other systems or requiring complex setup. It provides developers with a virtualized or containerized execution space where dependencies, environment variables, and runtime contexts can be fully controlled and discarded after use.
You should use a sandbox to:
- Execute untrusted or user-generated code securely
- Prototype applications quickly
- Test APIs or libraries in clean environments
- Demonstrate functionality without configuring local infrastructure
Sandboxes are especially valuable in platforms for AI model evaluation, online coding environments, CI/CD pipelines, and educational tools that require safe, reproducible, and on-demand compute environments.
The Koyeb Sandbox SDK
The Koyeb Python Sandbox SDK includes both synchronous (Sandbox) and asynchronous (AsyncSandbox) classes, and the JavaScript SDK has a synchronous class allowing developers to:
- Launch new sandbox instances
- Wait for readiness and TCP proxy availability
- Expose or unexpose internal ports
- Execute background processes and list or terminate them
- Access sandbox filesystem and execution interfaces
- Clean up resources automatically
View the Koyeb Python SDK on GitHub View the Koyeb Sandboxes SDK for JavaScript on GitHub
Get started with sandboxes
Sandboxes are available for users on the Starter, Pro, or Scale plans. Learn more about Koyeb subscription plans .
Here’s how to get started:
- Walk through the quicksart
- Learn about the lifecycle of a sandbox
- Take actions on files
- Run commands in your sandbox