> ## Documentation Index
> Fetch the complete documentation index at: https://api.vitarelay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Environments

> One base URL, two key environments — live and test.

# Environments

VitaRelay does **not** run separate hosts for production and testing. There is
one base URL:

```
https://vitarelay.com/api/public/v1
```

The environment is a property of the **key**, not the URL. Send a `vr_live_` key
and the request acts on production. Send a `vr_test_` key and the exact same
request is handled by the isolated sandbox.

## Live keys

* Prefix `vr_live_`
* Reads return your organization's real records
* Writes create real patients, intakes, and orders
* Order creation charges the clinic's card on file and routes for fulfillment
* Real webhooks fire from real lifecycle events

## Test keys

* Prefix `vr_test_`
* Validation, request shapes, response shapes, and error codes are identical to live
* Nothing real is written — no patients, no intakes, no orders
* No card is ever charged
* Responses carry synthetic identifiers (`sandbox_pat_…`, `sandbox_int_…`,
  `sandbox_ord_…`) and `"sandbox": true`
* A simulated lifecycle fires sandbox-marked webhooks

See [Sandbox](/getting-started/sandbox) for the full behavior.

<Note>
  A test key can never read or modify live data, and a live key can never see
  sandbox objects. The two sets never intersect.
</Note>

## Switching environments

Because the URL is the same, switching environments means swapping one
environment variable.

```bash theme={null}
# .env.production (never commit)
VITARELAY_API_KEY=vr_live_xxxxxxxxxxxxxxxxxxxx
VITARELAY_API_URL=https://vitarelay.com/api/public/v1

# .env.development
VITARELAY_API_KEY=vr_test_xxxxxxxxxxxxxxxxxxxx
VITARELAY_API_URL=https://vitarelay.com/api/public/v1
```

<Warning>
  Guard the swap in your deployment config. Because the URL does not change, a
  live key pasted into a development environment will happily create real
  orders.
</Warning>
