## sandbox

If your CLI isn't logged into Stripe, this command provisions a new sandbox with working test API keys, without requiring an account. This enables you, a coding agent, or an automated workflow to start building a Stripe integration immediately.

Your temporary sandbox credentials are saved to your CLI profile so that other commands work without needing to log in. You can convert a sandbox into a full Stripe account within seven days with the `sandbox claim` command.

If you're already [logged in](https://docs.stripe.com/cli/login.md), `sandbox create` opens the sandbox management page in your Stripe Dashboard.

> Sandbox environments expire after 7 days. Claim your sandbox before it expires by running `stripe sandbox claim` to keep your account and data.

**Command:** `stripe sandbox <command> [flags]`

### Subcommands

- `create`
  Provision a new sandbox environment with test API keys. Uses a proof-of-work challenge to verify the request, then saves the keys to your current CLI profile so subsequent `stripe` commands work immediately.

- `claim`
  Open the claim URL for your active sandbox in a browser. After claiming, run `stripe login` to get permanent keys.

### Flags for sandbox create

- `--email <address>`
  Your email address. Required unless `--from-git` is used. Mutually exclusive with `--from-git`.

- `--from-git`
  Infer your email and full name from `git config user.email` and `git config user.name`. Mutually exclusive with `--email`.

- `--full-name <name>`
  Your full name (optional). Automatically inferred if `--from-git` is used.

- `--non-interactive`
  Print output directly without waiting for input. Useful for scripting and agent-assisted workflows.

### Flags for sandbox claim

- `--non-interactive`
  Print the claim URL directly without waiting for input.

### Examples

**Create a sandbox with an email**

```sh
stripe sandbox create --email you@example.com
```

```
Setting up your sandbox... done.
{
  "secret_key": "rkcs_test_abc123",
  "publishable_key": "pk_test_def456",
  "claim_url": "https://dashboard.stripe.com/onboard_sandbox/0000000...",
  "account_id": "acct_ghi789",
  "expires_at": "2026-06-23"
}

Use the keys above to start building your integration.

This sandbox expires 2026-06-23 (in 7 days). Claim it before then by using the above claim_url or running `stripe sandbox claim`.
```

**Create a sandbox using git config**

```sh
stripe sandbox create --from-git
```

```
Using email: you@example.com (from git config)
Setting up your sandbox... done.
{
  "secret_key": "rkcs_test_abc123",
  "publishable_key": "pk_test_def456",
  "claim_url": "https://dashboard.stripe.com/onboard_sandbox/0000000...",
  "account_id": "acct_ghi789",
  "expires_at": "2026-06-23"
}

Use the keys above to start building your integration.

This sandbox expires 2026-06-23 (in 7 days). Claim it before then by using the above claim_url or running `stripe sandbox claim`.
```

**Claim your sandbox**

```sh
stripe sandbox claim
```

```
Claim your sandbox (acct_ghi789) by visiting the claim link below.

Press Enter to open the browser or visit https://dashboard.stripe.com/onboard_sandbox/000000...
```
