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

# Premiers pas avec les sandboxes serverless

> Exécutez votre premier sandbox serverless avec une clé API W&B.

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

Obtenez votre [clé API W\&B](https://forge.coreweave.com/settings#apikeys). Si vous n'avez pas de compte, inscrivez-vous à partir de ce même lien. Définissez ensuite la clé dans votre terminal :

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

<Tabs>
  <Tab title="Python">
    Une fois [`uv`](https://docs.astral.sh/uv/getting-started/installation/) installé, enregistrez ce code sous le nom `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)
    ```

    Exécutez-le avec Python 3.11 et le client sandbox. La commande les installe si nécessaire :

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

  <Tab title="TypeScript">
    Une fois Node.js 22 ou une version ultérieure installée, installez le client :

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

    Enregistrez ce code sous le nom `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);
    ```

    Exécutez-le avec `tsx` :

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

Ces exemples utilisent une clé issue de [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>

Si votre organisation utilise le Cloud dédié W\&B, consultez [Utiliser des sandboxes avec le Cloud dédié W\&B](/fr/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.
