Examples and guides for using the OpenAI API
Self-hosted sandbox examples
Choose how your application starts sandbox compute. Both modes run the agent in
OpenAI's cloud and connect the sandbox through codex exec-server.
| Mode | Your application | Sandbox provisioning |
|---|---|---|
| Application-managed | Run the provider's application_managed/main.py. |
Your application starts and stops compute directly; no webhook handler. |
| Webhook-managed | Run the provider's webhook-managed example to send input and follow the turn. | A separately deployed handler starts or reconnects compute when OpenAI sends a webhook. |
Choose one provisioning mode per session. Deleting an API session does not stop provider compute; each example documents cleanup of both.
Choose a provider
| Provider | Application-managed | Webhook-managed |
|---|---|---|
| Blaxel | Run | Deploy |
| Cloudflare | Run | Deploy |
| Databricks | Run | Not included |
| Daytona | Run | Deploy |
| DigitalOcean | Run | Deploy |
| Docker | Run | Not included |
| E2B | Run | Deploy |
| Modal | Run | Deploy |
| AWS Lambda MicroVMs | Run | Deploy |
| OCI | Run | Not included |
| Vercel | Run | Deploy |
Each provider folder contains its examples and shared sandbox setup. Webhook examples include their own client; they do not import code from another provider. Run commands from the Cookbook repository root unless the provider README says otherwise.