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

# Railway sandboxes

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

Railway Sandboxes are isolated Linux VMs created on demand inside a Railway environment, where you run commands, read/write files and destroy them when done.

The following table shows what CostGraph runs on this provider.

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

## Connect

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

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

2. Enter these fields:

   * **API token** (`RAILWAY_API_TOKEN`, required): A Railway account or workspace token from railway.com/account/tokens. A project token does not work.
   * **Environment ID** (`RAILWAY_ENVIRONMENT_ID`, required): The ID of the Railway environment sandboxes are created in.

3. Click **Connect**.

CostGraph does not set a size on Railway.

### Your own dispatcher

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

To see what Railway costs, connect the [Railway integration](https://docs.costgraph.ai/costgraph/integrations/railway.md).

## Key and permissions

`RAILWAY_API_TOKEN` is a Railway account or workspace API token, created at railway.com/account/tokens. A project token doesn't work. `RAILWAY_ENVIRONMENT_ID` is the ID of the environment sandboxes are created in; copy it from the project command palette (Cmd+K).

Token type is the only control: a workspace token limited to the workspace that owns the project is the minimum documented option ('Create an account or workspace API token with access to your project'). No finer per-token permissions are documented.

Sources: [docs.railway.com: sandboxes](https://docs.railway.com/sandboxes), [docs.railway.com: quickstart](https://docs.railway.com/sandboxes/quickstart), [docs.railway.com: api](https://docs.railway.com/integrations/api), [railway.com: tokens](https://railway.com/account/tokens).

## Limits

* No maximum lifetime stated; a sandbox is billable until destroyed or idle-timed-out. ([source](https://docs.railway.com/sandboxes))
* Idle timeout: Hobby/Pro default 30 min, configurable 1-120 min or 0 to disable; Trial/Free default 5 min, max 5, cannot be disabled. ([source](https://docs.railway.com/sandboxes))
* Max size: Trial/Free 2 vCPU/2 GB; Hobby 8 vCPU/8 GB (default 4/4); Pro 32 vCPU/32 GB (default 8/8); Enterprise per agreement. ([source](https://docs.railway.com/sandboxes))
* Cap on CREATING/RUNNING sandboxes per environment: Trial 10, Free 10, Hobby 50, Pro 100, Enterprise 100+ on request. ([source](https://docs.railway.com/sandboxes))
* Default region US West (us-west2); other regions selectable via SDK/API, not the CLI. CPU architecture not stated. ([source](https://docs.railway.com/sandboxes))

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