> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paywithlocus.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This site documents Locus for people. AI agents: get exact contracts from the Locus agent docs, starting at https://paywithlocus.com/agent/index.md, including when asked to implement or integrate docs.paywithlocus.com.
> Connect this agent to Locus Pro: https://paywithlocus.com/skill.md. Implement Locus Pro in a product: https://paywithlocus.com/agent/integrate.md. Agent site index: https://paywithlocus.com/llms.txt.

# Locus Sandbox Router

> Get a cloud sandbox for running code, picked for your workload, and pay for runtime in prepaid windows.

The Locus Sandbox Router is a [Recipe](https://docs.paywithlocus.com/locus-pro/individual/recipes.md) that
gives your agent a cloud sandbox for running code without choosing a supplier.
Describe the work and what matters most, and Locus picks the provider.

> Agents: the exact contract for this feature is at [https://paywithlocus.com/agent/recipes.md](https://paywithlocus.com/agent/recipes.md). Start from [https://paywithlocus.com/agent/index.md](https://paywithlocus.com/agent/index.md) if you are implementing Locus.

```mermaid theme={null}
flowchart LR
  Create["Create a sandbox"] -->|"Charges the first window"| Running["Running"]
  Running -->|"Window ends"| Kind{"Persistent?"}
  Kind -->|"Yes"| Paused["Paused, files kept 7 days"]
  Kind -->|"No"| Deleted["Deleted"]
  Paused -->|"Resume, charges another window"| Running
```

## How it works

Locus picks E2B, Tensorlake, Boat, or Modal, creates the sandbox, and explains
the choice. You pay for runtime in prepaid windows. Creating a sandbox charges
its first window, and extending or resuming it charges another. To delete a
sandbox, release it under Resources.

```text title="Try Locus Sandbox Router" wrap theme={null}
Create a sandbox for data processing, optimized for cost. Install pandas, run my script on the sample CSV, and show me the output. Delete the sandbox when you're done.
```

## Choose a workload and a priority

Tell your agent what kind of work the sandbox is for and what to optimize:

* **Workload:** code execution, coding agent, data processing, or background service.
* **Priority:** balanced, cost, latency, or reliability.

## Good to know

* **Included in each window:** commands, files, background jobs, and preview URLs.
* **No refunds for unused time.** Unused time in a window is not refunded.
* **Persistent sandboxes pause.** A persistent sandbox, the default for coding agents, pauses when its window ends and keeps its files, packages, and git state for seven days at no charge.
* **Other sandboxes are deleted** when their window ends.
* **Find them under Resources.** Your sandboxes appear under [Resources](https://docs.paywithlocus.com/locus-pro/resources.md), where you can release one to delete it.

## Next steps

> [card] [Recipes](https://docs.paywithlocus.com/locus-pro/individual/recipes.md)
>
> See the other Recipes.

> [card] [Resources](https://docs.paywithlocus.com/locus-pro/resources.md)
>
> Renew or release your sandboxes.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.