Sandbox defaults to 1 CPU, 128 MiB memory, Python 3.11, and a 600-second lifetime. Increase memory for package installation, browsers, or data processing.
API_KEY workspace secret before starting this example. Use secrets for credentials and env for nonsecret configuration. A plaintext value in a source file remains in that file even when passed as an environment variable.
Add gpu, gpu_count, or pool for workloads that need suitable GPU capacity or a compute pool. Requesting a GPU does not install your application’s CUDA libraries; include those in the image.
Persistent Storage
Lifetime
keep_warm_seconds is the sandbox’s TTL, not an idle timeout that every command automatically resets. Use -1 for a sandbox that you will terminate explicitly. Running processes do not make a finite TTL unlimited.