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

# CodeSandbox sandboxes

> Run CostGraph workflows and CI jobs in CodeSandbox sandboxes: the key to create, its permissions, and its limits

CodeSandbox SDK (now part of Together AI) programmatically creates and runs Firecracker-based VM sandboxes billed to a CodeSandbox workspace.

The following table shows what CostGraph runs on this provider.

| Workflows | CI runners | Connect with |
| - | - | - |
| Yes | Yes | Integrations or your own dispatcher |

## Connect

Connect CodeSandbox on Integrations, and CostGraph starts sandboxes in your CodeSandbox account. You don't run anything yourself.

1. In CostGraph, go to **Integrations > Sandbox > CodeSandbox**.

2. Enter these fields:

   * **API token** (`CSB_API_KEY`, required): A CodeSandbox workspace API token from codesandbox.io/t/api.

3. Click **Connect**.

For CI runners, CostGraph picks the smallest VM tier that fits the job.

### Your own dispatcher

To keep the key out of CostGraph or reach a private network, run your own dispatcher instead.
Set `provider` to `codesandbox` and the preceding fields as environment variables, as described in [Run your own dispatcher](https://docs.costgraph.ai/costgraph/workflows/managed-sandboxes.md#run-your-own-dispatcher).

## Key and permissions

CSB\_API\_KEY is a CodeSandbox workspace API token, created at [https://codesandbox.io/t/api](https://codesandbox.io/t/api) with 'Create API Token'; it is revoked from the Permissions tab of Workspace Settings. Sandboxes are created and billed in the token's workspace.

Tokens are scoped (scopes in the vendor API: sandbox\_create, sandbox\_read, sandbox\_edit\_code, vm\_manage), but CodeSandbox does not document a per-operation minimum; its SDK quickstart says to "enable all scopes".

Sources: [codesandbox.io: sdk](https://codesandbox.io/docs/sdk), [codesandbox.io: api](https://codesandbox.io/t/api), [codesandbox.io: sandboxes](https://codesandbox.io/docs/sdk/sandboxes), [codesandbox.io: key terms](https://codesandbox.io/docs/sdk/key-terms), [codesandbox.io: faq](https://codesandbox.io/docs/sdk/faq).

## Limits

* Hibernation timeout configurable from 1 minute to 24 hours; default 5 minutes on free and 30 minutes on paid workspaces (from the vendor sandboxes page; the page blocks automated fetching, read via search-index excerpt). ([source](https://codesandbox.io/docs/sdk/sandboxes))
* VM tiers from Micro up to Small (8 cores / 16 GB) by default, higher tiers only via custom templates; available tiers depend on the workspace subscription (same caveat as above). ([source](https://codesandbox.io/docs/sdk/key-terms))

## Related

* [Supported sandbox providers](https://docs.costgraph.ai/costgraph/workflows/sandbox-providers.md)
* [Run workflows on a managed sandbox provider](https://docs.costgraph.ai/costgraph/workflows/managed-sandboxes.md)
* [Run CI jobs in sandboxes](https://docs.costgraph.ai/costgraph/autopilot/ci-sandboxes.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.