> ## 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 W&B API key.

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" />

Get your [W\&B API key](https://forge.coreweave.com/settings#apikeys). If you don't have an account, sign up through the same link. Then set the key in your terminal:

```bash theme={"system"}
export WANDB_API_KEY="[WANDB-API-KEY]"
```

<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.WANDB,
        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[wandb]>=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/wandb";

    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>

These examples use a key from [wandb.ai](https://wandb.ai).

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).

<Note>
  Serverless Sandboxes is generally available, and usage is billed. Access is enabled per organization. To request access for your organization, contact [support](mailto:forge-support@coreweave.com).
</Note>

If your organization uses W\&B Dedicated Cloud, follow [Use sandboxes with W\&B Dedicated Cloud](/products/sandboxes/serverless/wandb-dedicated).

## 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:

* [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.


## Related topics

- [Get started with serverless sandboxes](/products/sandboxes/get-started.md)
