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

# Get started with serverless sandboxes

> Run your first serverless sandbox with a CoreWeave API access token.

Run a command in a serverless sandbox and print its output. No cluster setup is required.

## Run your first sandbox

<span id="choose-a-credential" />

<span id="run-a-sandbox-on-serverless-capacity" />

Ask your administrator to create or update an [Access Policy](https://console.coreweave.com/organization/iam/access-policies) granting you the **Sandbox User** role. See [Create an access policy](/security/iam/access-policies/manage#create-an-access-policy) for the steps.

Create an API access token on the [Tokens](https://console.coreweave.com/tokens) page, copy its **Token Secret**, and set it in your terminal:

```bash theme={"system"}
export CWSANDBOX_API_KEY="[API-ACCESS-TOKEN]"
```

<Tabs>
  <Tab title="Python">
    With [`uv`](https://docs.astral.sh/uv/getting-started/installation/) installed, save this as `hello.py`:

    ```python title="hello.py" theme={"system"}
    from cwsandbox import AuthStrategy, Sandbox

    with Sandbox.run(
        auth=AuthStrategy.COREWEAVE_API_KEY,
        resources={"cpu": "1", "memory": "1Gi"},
    ) as sandbox:
        print(sandbox.exec(["echo", "Hello!"]).result().stdout)
    ```

    Run it with Python 3.11 and the sandbox client. The command installs them if needed:

    ```bash theme={"system"}
    uv run --python 3.11 --with 'cwsandbox>=1.10.0' hello.py
    ```
  </Tab>

  <Tab title="TypeScript">
    With Node.js 22 or later installed, install the client:

    ```bash theme={"system"}
    npm install @coreweave/cwsandbox
    ```

    Save this as `hello.mts`:

    ```typescript title="hello.mts" theme={"system"}
    import { createSandboxClientFromEnv } from "@coreweave/cwsandbox/node";

    const client = createSandboxClientFromEnv();
    const result = await client.withSandbox(
      async (sandbox) => sandbox.commands.run(["echo", "Hello!"]),
      { resources: { cpu: "1", memory: "1Gi" } },
    );
    console.log(result.stdout);
    ```

    Run it with `tsx`:

    ```bash theme={"system"}
    npx --yes --package=tsx tsx hello.mts
    ```
  </Tab>
</Tabs>

The example prints the following output and stops the sandbox when it finishes:

```text title="Output" theme={"system"}
Hello!
```

The sandbox has 1 CPU and 1 GiB of memory. Serverless sets resource limits equal to requests. Change `resources` to choose its CPU and memory.

For concurrent quotas, rate limits on create requests, and quota errors, see [Limits and quotas](reference/limits-and-quotas).

For account requirements and token setup, see [Choose and get credentials](/products/sandboxes/placement#choose-and-get-credentials).

## Next steps

<span id="choose-a-placement-mode" />

<span id="spill-over-between-modes" />

<span id="deploy-sandboxes-on-your-own-cks-cluster" />

Continue with the guide for your workload:

* [Use your own compute](/products/sandboxes/get-started-cks): enable a runner on your cluster and run a sandbox there.
* [Sandbox placement and spillover](/products/sandboxes/placement): compare serverless and CKS capacity and configure fallback.

- [Run coding agents](agents): connect a coding agent to a sandbox.
- [GPU sandboxes](gpu-sandboxes): request GPU access and run a GPU workload.
- [Python client](/products/sandboxes/client): execute commands, work with files, and configure sandboxes.
