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

# CoreWeave Sandboxes 시작하기

> Forge API 키 또는 CoreWeave API 액세스 토큰으로 서버리스 용량에서 첫 샌드박스를 실행해 보세요.

서버리스 용량에서 실행되는 샌드박스에서 명령어를 실행하고 출력을 확인해 보세요. 클러스터를 따로 설정할 필요가 없습니다.

<h2 id="before-you-begin">
  시작하기 전에
</h2>

서버리스 샌드박스는 정식 출시되었으며, 사용량에 따라 요금이 청구됩니다. 액세스는 조직 단위로 활성화됩니다. 조직의 액세스 권한을 요청하려면 [지원팀](mailto:forge-support@coreweave.com)에 문의하세요.

조직에서 Forge Dedicated Cloud를 사용하는 경우 [Forge Dedicated Cloud에서 샌드박스 사용하기](/ko/products/sandboxes/dedicated-cloud)를 참조하세요.

<h2 id="run-your-first-sandbox">
  첫 번째 샌드박스 실행하기
</h2>

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

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

샌드박스를 소유하고 비용을 청구받을 계정의 사용자 인증 정보를 선택하세요. Forge API 키는 서버리스 배치를 지원합니다. CoreWeave API 액세스 토큰은 서버리스 배치와 CoreWeave Kubernetes Service(CKS) 배치를 모두 지원합니다. 계정 요구 사항은 [사용자 인증 정보 선택 및 발급](/ko/products/sandboxes/placement#choose-and-get-credentials)을 참조하세요. 사용하는 사용자 인증 정보에 해당하는 섹션의 안내를 따른 다음 [결과를 확인](#verify-the-result)하세요.

<h3 id="forge-api-key">
  Forge API 키
</h3>

[Forge API 키](https://forge.coreweave.com/settings#apikeys)를 발급받으세요. 계정이 없다면 같은 링크에서 가입할 수 있습니다. 그런 다음 터미널에서 키를 설정하세요. 예시 코드는 `FORGE_API_KEY`를 명시적으로 읽습니다. SDK는 이 변수를 자동으로 감지하지 않습니다.

```bash theme={"system"}
export FORGE_API_KEY="[FORGE-API-KEY]"
```

<Tabs>
  <Tab title="Python">
    [`uv`](https://docs.astral.sh/uv/getting-started/installation/)를 설치한 다음, 아래 코드를 `hello.py`로 저장하세요.

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

    forge_auth = AuthHeaders(
        headers={"x-wandb-api-key": os.environ["FORGE_API_KEY"]},
        strategy="wandb_api_key",
    )

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

    Python 3.11과 샌드박스 클라이언트로 실행하세요. 둘 다 필요하면 이 명령어가 자동으로 설치합니다.

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

  <Tab title="TypeScript">
    Node.js 22 이상을 설치한 다음, 클라이언트를 설치하세요.

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

    아래 코드를 `hello.mts`로 저장하세요.

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

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

    `tsx`로 실행하세요.

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

`x-wandb-api-key` 헤더, `wandb_api_key` 전략 식별자, TypeScript `/wandb` 진입점은 현재 SDK에서 Forge 인증에 사용하는 식별자입니다. 이 식별자는 변경하지 말고 그대로 사용하세요.

<h3 id="coreweave-api-access-token">
  CoreWeave API 액세스 토큰
</h3>

Admin에게 **Sandbox User** 역할을 부여하는 [액세스 정책](https://console.coreweave.com/organization/iam/access-policies)을 생성하거나 업데이트해 달라고 요청하세요. 자세한 단계는 [액세스 정책 생성](/security/iam/access-policies/manage#create-an-access-policy)을 참조하세요.

[Tokens](https://console.coreweave.com/tokens) 페이지에서 API 액세스 토큰을 생성한 후 **Token Secret**을 복사하여 터미널에 다음과 같이 설정하세요.

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

<Tabs>
  <Tab title="Python">
    [`uv`](https://docs.astral.sh/uv/getting-started/installation/)가 설치되어 있다면 다음 코드를 `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)
    ```

    Python 3.11과 샌드박스 클라이언트를 사용해 실행하세요. 둘 중 설치되지 않은 것이 있으면 이 명령어가 자동으로 설치합니다.

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

  <Tab title="TypeScript">
    Node.js 22 이상이 설치되어 있다면 클라이언트를 설치하세요.

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

    다음 코드를 `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);
    ```

    `tsx`로 실행하세요.

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

<h3 id="verify-the-result">
  결과 확인
</h3>

이 예시는 다음과 같은 출력을 표시하고, 실행이 끝나면 샌드박스를 중지합니다.

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

샌드박스에는 CPU 1개와 메모리 1GiB가 할당됩니다. 서버리스에서는 리소스 제한이 요청량과 동일하게 설정됩니다. CPU와 메모리를 직접 선택하려면 `resources`를 변경하세요.

동시 실행 할당량, 생성 요청에 대한 요청 속도 제한, 할당량 오류에 대한 자세한 내용은 [제한 및 할당량](/ko/products/sandboxes/reference/limits-and-quotas)을 참조하세요.

<h2 id="next-steps">
  다음 단계
</h2>

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

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

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

워크로드에 맞는 가이드를 이어서 확인하세요.

* [자체 컴퓨팅 사용](/ko/products/sandboxes/get-started-cks): 클러스터에서 러너를 활성화하고 샌드박스를 실행하세요.
* [샌드박스 배치 및 스필오버](/ko/products/sandboxes/placement): 서버리스 용량과 CKS 용량을 비교하고 폴백을 설정하세요.
* [코딩 에이전트 실행](/ko/products/sandboxes/agents): 코딩 에이전트를 샌드박스에 연결하세요.
* [GPU 샌드박스](/ko/products/sandboxes/gpu-sandboxes): GPU 액세스를 요청하고 GPU 워크로드를 실행하세요.
* [Python 클라이언트](/ko/products/sandboxes/client): 명령어 실행, 파일 작업, 샌드박스 설정 방법을 알아보세요.
