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

# StateSet sandboxes

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

StateSet Sandbox runs commands in isolated runtimes behind an HTTP controller API (api.sandbox.stateset.app), with create, execute, status, stop and delete operations.

The following table shows what CostGraph runs on this provider.

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

## Connect

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

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

2. Enter these fields:

   * **API key** (`STATESET_API_KEY`, required): A StateSet Sandbox API key.
   * **API URL** (`STATESET_API_URL`, optional): A different StateSet Sandbox API address, if you do not use the default.
   * **Resource class** (`STATESET_RESOURCE_CLASS`, optional): The StateSet resource class: shared or dedicated.

3. Click **Connect**.

### Your own dispatcher

To keep the key out of CostGraph or reach a private network, run your own dispatcher instead.
Set `provider` to `stateset` 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

STATESET\_API\_KEY is a StateSet Sandbox API key (sent as 'Authorization: ApiKey \<key>'), obtained by signing up at sandbox.stateset.app or POST /api/v1/register; a usable key is issued only after email verification.

Use an API key that can create, inspect, execute in and stop a sandbox. StateSet doesn't publish scope names.

Sources: [docs.stateset.com: stateset sandbox quickstart](https://docs.stateset.com/stateset-sandbox/stateset-sandbox-quickstart), [docs.stateset.com: overview](https://docs.stateset.com/api-reference/sandbox/overview.md), [docs.stateset.com: stateset sandbox sdk node](https://docs.stateset.com/stateset-sandbox/stateset-sandbox-sdk-node).

## Limits

* Lifetime is capped by plan: non-durable sandboxes run up to 24 hours. ([source](https://docs.stateset.com/api-reference/sandbox/overview.md))
* Runtime and quota policies can reject a request; CPU/memory maximums, resource\_class, regions and architecture are not documented. ([source](https://docs.stateset.com/stateset-sandbox/stateset-sandbox-quickstart))
* Docs warn a published reference does not establish that the hosted service is available; requires a provisioned deployment. ([source](https://docs.stateset.com/stateset-sandbox/stateset-sandbox-quickstart))

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