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

# Environments: live and test

> Understand the difference between live and test projects and how the API key defines the environment of your requests.

Routa has a single endpoint for every environment:

```text theme={null}
https://api.routa.chat
```

The environment does **not** change the URL. It is defined by the **project** the API key belongs to, and the key prefix tells you which one it is.

| Key | Project | Use |
| - | - | - |
| `rt_live_...` | `live` | Real production traffic. |
| `rt_test_...` | `test` | Development and automated tests. |

To switch environments, switch the key. Do not change the URL.

## What changes in a test project

A `test` project runs **exactly the same code paths** as a `live` project: same validation, same message lifecycle, same events, same errors. The differences are in:

* **What it can connect.** A test project only connects sandbox credentials from the provider.
* **Billing.** Messages from test projects are neither counted nor blocked by your plan allowance.
* **Local webhooks.** `http://` endpoints on `localhost` are accepted only in test projects. In a live project, the URL must be HTTPS and cannot point to private or loopback addresses.

> [!WARNING]
>
> Never use an `rt_live_` key in automated tests. A message sent by a live project reaches the real recipient and counts against your allowance.

## How to tell which environment you are in

The key prefix shows the environment. To confirm the project, call `GET /v1/whoami`:

```bash theme={null}
curl https://api.routa.chat/v1/whoami \
  -H "Authorization: Bearer $ROUTA_API_KEY"
```

## Pointing to another host

To point the SDK at another instance, such as a local or staging installation, set `baseURL`:

```ts theme={null}
const routa = new Routa({
  apiKey: process.env['ROUTA_API_KEY']!,
  baseURL: 'http://localhost:3000',
})
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.