Connect
Connect CodeSandbox on Integrations, and CostGraph starts sandboxes in your CodeSandbox account. You don’t run anything yourself.- In CostGraph, go to Integrations > Sandbox > CodeSandbox.
-
Enter these fields:
- API token (
CSB_API_KEY, required): A CodeSandbox workspace API token from codesandbox.io/t/api.
- API token (
- Click Connect.
Your own dispatcher
To keep the key out of CostGraph or reach a private network, run your own dispatcher instead. Setprovider to codesandbox and the preceding fields as environment variables, as described in Run your own dispatcher.
Key and permissions
CSB_API_KEY is a CodeSandbox workspace API token, created at 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, codesandbox.io: api, codesandbox.io: sandboxes, codesandbox.io: key terms, codesandbox.io: 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)
- 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)