# Quickstart & self-serve sandbox

Canonical URL: https://docs.chartvoyant.com/getting-started/

Every developer starts in an isolated synthetic sandbox office. Issuing a key takes about a minute, requires no BAA or contract signature, and gives you full read and write access to synthetic test patients for 14 days.

## 1. Request a sandbox key

- **Open the sandbox request modal** Click Request a sandbox key, enter your email, full name, phone number, and optional company name, and accept the [ChartVoyant Sandbox Terms](https://chartvoyant.com/sandbox-terms/).

- **Verify your email with the 6-digit code** ChartVoyant sends a one-time 6-digit code to your email (valid for 15 minutes). Enter it in the same modal.

- **Copy and store your key immediately** Verification provisions a dedicated synthetic office and displays your `cvk_…` bearer token **exactly once**. Store it in an environment variable or secrets manager; ChartVoyant stores only a hash and emails only the last four characters.

```
export CHARTVOYANT_API_KEY="cvk_0123456789ab_YOUR_SYNTHETIC_SANDBOX_SECRET"
```

## 2. Verify your practice context

Call `GET /context` on `https://chartvoyant.com/api/v1` (the single base URL for both sandbox and production keys) to confirm the synthetic tenant your key resolves to:

    cURLTypeScriptPython
    Copy

```
curl "https://chartvoyant.com/api/v1/context" \
  -H "Authorization: Bearer $CHARTVOYANT_API_KEY"
```

```
const ctx = await fetch("https://chartvoyant.com/api/v1/context", {
  headers: { Authorization: `Bearer ${process.env.CHARTVOYANT_API_KEY}` }
}).then((r) => r.json());
console.log(ctx);
```

```
import os, json, urllib.request

req = urllib.request.Request(
    "https://chartvoyant.com/api/v1/context",
    headers={"Authorization": f"Bearer {os.environ['CHARTVOYANT_API_KEY']}"},
)
print(json.loads(urllib.request.urlopen(req).read()))
```

### One base URL for sandbox and production: chartvoyant.com/api/v1

Self-serve sandbox keys are issued by and authenticated on `https://chartvoyant.com/api/v1`. Never point a sandbox key at `demo.chartvoyant.com` — the public clinician demo is a separate deployment with its own database and rejects sandbox keys with `401`.

## 3. Search and create synthetic patients

Your sandbox office comes pre-seeded with synthetic patients, encounters, and chart data, and your sandbox key carries `full` (read + write) access within that synthetic office:

```
# List synthetic patients
curl "https://chartvoyant.com/api/v1/patients?limit=5" \
  -H "Authorization: Bearer $CHARTVOYANT_API_KEY"

# Create a synthetic test patient
curl -X POST "https://chartvoyant.com/api/v1/patients" \
  -H "Authorization: Bearer $CHARTVOYANT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"mrn":"MRN-SYN-901","name":{"family":"Synthetic","given":[" Jordan"]},"birthDate":"1982-06-14"}'
```

## 4. Connect an MCP client to your sandbox

The exact same `cvk_…` sandbox key authenticates against the [Practice MCP server](https://docs.chartvoyant.com/mcp/):

```
claude mcp add --transport http chartvoyant https://chartvoyant.com/api/v1/mcp \
  --header "Authorization: Bearer $CHARTVOYANT_API_KEY"
```

## Sandbox boundaries

- **Synthetic data only.** Never submit real patient names, dates of birth, SSNs, or clinical records into a sandbox office.

- **14-day lifetime, one active key per email.** When a sandbox key expires after 14 days, its synthetic office closes automatically; request a fresh key anytime.

- **Completely air-gapped from outbound channels.** Sandbox offices never send real faxes, SMS messages, emails, phone calls, prescriptions, or clearinghouse claims.

- **Dedicated rate budget.** Self-serve sandbox keys allow 38 requests/second, 900 requests/minute, and 5,000 requests/day.
