modal
    Preparing search index...

    Type Alias SandboxCreateParams

    Optional parameters for client.sandboxes.create().

    type SandboxCreateParams = {
        blockNetwork?: boolean;
        cidrAllowlist?: string[];
        cloud?: string;
        cloudBucketMounts?: Record<string, CloudBucketMount>;
        command?: string[];
        cpu?: number;
        cpuLimit?: number;
        customDomain?: string;
        encryptedPorts?: number[];
        env?: Record<string, string>;
        experimentalOptions?: Record<string, any>;
        gpu?: string;
        h2Ports?: number[];
        idleTimeoutMs?: number;
        memoryLimitMiB?: number;
        memoryMiB?: number;
        name?: string;
        proxy?: Proxy;
        pty?: boolean;
        regions?: string[];
        secrets?: Secret[];
        timeoutMs?: number;
        unencryptedPorts?: number[];
        verbose?: boolean;
        volumes?: Record<string, Volume>;
        workdir?: string;
    }
    Index

    Properties

    blockNetwork?: boolean

    Whether to block all network access from the Sandbox.

    cidrAllowlist?: string[]

    List of CIDRs the Sandbox is allowed to access. If None, all CIDRs are allowed. Cannot be used with blockNetwork.

    cloud?: string

    Cloud provider to run the Sandbox on.

    cloudBucketMounts?: Record<string, CloudBucketMount>

    Mount points for CloudBucketMounts.

    command?: string[]

    Sequence of program arguments for the main process. Default behavior is to sleep indefinitely until timeout or termination.

    cpu?: number

    Reservation of physical CPU cores for the Sandbox, can be fractional.

    cpuLimit?: number

    Hard limit of physical CPU cores for the Sandbox, can be fractional.

    customDomain?: string

    If set, connections to this Sandbox will be subdomains of this domain rather than the default. This requires prior manual setup by Modal and is only available for Enterprise customers.

    encryptedPorts?: number[]

    List of ports to tunnel into the Sandbox. Encrypted ports are tunneled with TLS.

    env?: Record<string, string>

    Environment variables to set in the Sandbox.

    experimentalOptions?: Record<string, any>

    Optional experimental options.

    gpu?: string

    GPU reservation for the Sandbox (e.g. "A100", "T4:2", "A100-80GB:4").

    h2Ports?: number[]

    List of encrypted ports to tunnel into the Sandbox, using HTTP/2.

    idleTimeoutMs?: number

    The amount of time in milliseconds that a Sandbox can be idle before being terminated.

    memoryLimitMiB?: number

    Hard limit of memory in MiB.

    memoryMiB?: number

    Reservation of memory in MiB.

    name?: string

    Optional name for the Sandbox. Unique within an App.

    proxy?: Proxy

    Reference to a Modal Proxy to use in front of this Sandbox.

    pty?: boolean

    Enable a PTY for the Sandbox.

    regions?: string[]

    Region(s) to run the Sandbox on.

    secrets?: Secret[]

    Secrets to inject into the Sandbox as environment variables.

    timeoutMs?: number

    Maximum lifetime of the Sandbox in milliseconds. Defaults to 5 minutes.

    unencryptedPorts?: number[]

    List of ports to tunnel into the Sandbox without encryption.

    verbose?: boolean

    Enable verbose logging.

    volumes?: Record<string, Volume>

    Mount points for Modal Volumes.

    workdir?: string

    Working directory of the Sandbox.