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

# Use sandboxes with W&B Dedicated Cloud

> Authenticate serverless sandboxes with an API key from your W&B Dedicated Cloud instance.

If your organization uses W\&B Dedicated Cloud, authenticate serverless sandboxes with an API key from your dedicated instance instead of `wandb.ai`. The Python client sends your key and instance hostname to the CoreWeave sandbox service, which validates the key against your instance. Point the client at your instance's URL to select the correct instance for authentication.

<Note>
  CoreWeave Serverless sandboxes are in public preview.
</Note>

## Before you begin

You need the following:

* Sandbox access enabled for your W\&B Dedicated Cloud instance. Contact your W\&B account team to confirm that your instance has the required server updates and to request access.
* The URL of your W\&B Dedicated Cloud instance, for example `https://[INSTANCE].wandb.io`. The hostname must end in `.wandb.io`. Instances on custom domains aren't supported.
* Python 3.11 or newer.

W\&B Self-Managed deployments, including air-gapped installations, aren't supported. The TypeScript client doesn't support Dedicated Cloud instances yet, so use the Python client.

## Get an API key from your instance

Create a personal API key on your dedicated instance, not on [wandb.ai/authorize](https://wandb.ai/authorize):

1. Sign in to your W\&B Dedicated Cloud instance.
2. Click your user profile icon, then click **User Settings**.
3. Scroll to the **API Keys** section and create a key.

W\&B shows the full key only once, when you create it. For more information, see [How do I find my API key?](https://docs.wandb.ai/support/models/articles/how-do-i-find-my-api-key#personal-api-key) in the W\&B documentation.

The key must be a personal (user) API key. Other W\&B credential types are rejected.

## Point the client at your instance

Install the Python client with the `wandb` extra:

```bash theme={"system"}
uv pip install 'cwsandbox[wandb]>=1.10.0'
```

Set your instance URL and API key. Replace `[INSTANCE]` with your instance's hostname prefix and `[WANDB-API-KEY]` with the key you created:

```bash theme={"system"}
export WANDB_BASE_URL="https://[INSTANCE].wandb.io"
export WANDB_API_KEY="[WANDB-API-KEY]"
```

The client resolves credentials through the `wandb` library, which reads `WANDB_BASE_URL` to determine which W\&B instance issued your key.

## Run a sandbox

Pass `auth=AuthStrategy.WANDB` to select W\&B authentication. Without it, the client looks for a CoreWeave API access token in `CWSANDBOX_API_KEY`.

```python theme={"system"}
from cwsandbox import AuthStrategy, Sandbox

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

If the command succeeds, `Hello!` appears in the output.

If authentication fails, confirm that `WANDB_BASE_URL` matches the instance where you created the key. A key from a dedicated instance doesn't authenticate against `wandb.ai`, and a `wandb.ai` key doesn't authenticate against a dedicated instance.

## Next steps

* [Get started with CoreWeave sandboxes](/products/sandboxes/get-started) covers placement modes, credentials, and spillover.
* The [Python client](/products/sandboxes/client) documentation covers lifecycle, execution, file operations, and other SDK patterns.


## Related topics

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